#include <iostream>#include <cmath>using namespace std;
int main(){ int n,k,n0,s,nr=0; cout<<"Introduceti suma cifrelor cat este: "; cin>>k; cout<<"Introduceti numere intregi, apasati Enter dupa fiecare numar"<<endl; cout<<"Programul se opreste cand introduceti valoarea 0"; cout<<endl; do { s=0; cin>>n; n0=n; while(n0!=0){ s+=n0%10; n0=n0/10; } if(k==abs(s)){ nr++; } }while(n!=0); cout<<nr<<" numere au suma cifrelor egala cu "<<k; return 0;}