Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void xD(int g, double &r)
- {
- double pop[14]={200,100,50,20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01};
- int i=0;
- while(r>=pop[g])
- {
- r=r-pop[g];
- i++;
- }
- if(i!=0)
- cout<<i<<"x"<<pop[g]<<"zl"<<endl;
- }
- int main()
- {
- double x, cena, r;
- cout<<"jaka jest cena: ";
- cin>>cena;
- cout<<"ile dales piniendzy: ";
- cin>>x;
- r=x-cena;
- for (int g=0;g<14;g++)
- xD(g,r);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement