Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {int s,pp=1,p,k=0,n,m;
- cout<<"dati suma ";
- cin>>s;
- cout<<"puterile numarului... ";
- cin>>n;
- cout<<"puterea la care sa ajunga...";
- cin>>p;
- while(k<p)
- {pp=pp*n;
- k++;}
- while(s>=0)
- {m=s/pp;
- cout<<endl;
- if(m>0)
- {cout<<"s-au folosit "<<m<<" bacnote de "<<pp;}
- s=s-(m*pp);
- pp=pp/n;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement