Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void xD(int g, double &r)
  5. {
  6. double pop[14]={200,100,50,20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01};
  7. int i=0;
  8. while(r>=pop[g])
  9. {
  10. r=r-pop[g];
  11. i++;
  12. }
  13. if(i!=0)
  14. cout<<i<<"x"<<pop[g]<<"zl"<<endl;
  15.  
  16. }
  17.  
  18. int main()
  19. {
  20. double x, cena, r;
  21. cout<<"jaka jest cena: ";
  22. cin>>cena;
  23. cout<<"ile dales piniendzy: ";
  24. cin>>x;
  25. r=x-cena;
  26. for (int g=0;g<14;g++)
  27. xD(g,r);
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement