Advertisement
Guest User

1021 - Manu

a guest
Mar 24th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define fori(i,n) for(int i=0;i<n;i++)
  3. #define foris(i,s,n) for(int i=s;i<n;i++)
  4.  
  5. using namespace std;
  6. const double pi=3.14159;
  7. int may(int a,int b){
  8. return (a+b+abs(a-b))/2;}
  9. double dist(double x1,double y1,double x2,double y2){
  10. return pow(pow((x2-x1),2)+pow((y2-y1),2),1/2.0);}
  11.  
  12. int main()
  13. {
  14. ios::sync_with_stdio(0);
  15. cin.tie(0);
  16. double k;
  17. cin>>k;
  18. double f,i;
  19. f=modf(k,&i);
  20. f=f*100.00;
  21. cout<<"NOTAS:"<<"\n";
  22. cout<<(int)i/100 <<" nota(s) de R$ 100,00"<<"\n";
  23. i=fmod(i,100);
  24. cout<<(int)i/50 <<" nota(s) de R$ 50,00"<<"\n";
  25. i=fmod(i,50);
  26. cout<< (int)i/20<<" nota(s) de R$ 20,00"<<"\n";
  27. i=fmod(i,20);
  28. cout<< (int)i/10<<" nota(s) de R$ 10,00"<<"\n";
  29. i=fmod(i,10);
  30. cout<<(int)i/5 <<" nota(s) de R$ 5,00"<<"\n";
  31. i=fmod(i,5);
  32. cout<<(int)i/2 <<" nota(s) de R$ 2,00"<<"\n";
  33. i=fmod(i,2);
  34. cout<<"MOEDAS:\n";
  35. cout<<(int)i/1.00 <<" moeda(s) de R$ 1,00"<<"\n";
  36. cout<<(int)f/50 <<" moeda(s) de R$ 0,50"<<"\n";
  37. f=fmod(f,50);
  38. cout<<(int)f/25 <<" moeda(s) de R$ 0,25"<<"\n";
  39. f=fmod(f,25);
  40. cout<<(int)f/10 <<" moeda(s) de R$ 0,10"<<"\n";
  41. f=fmod(f,10);
  42. cout<<(int)f/5<<" moeda(s) de R$ 0,05"<<"\n";
  43. f=fmod(f,5);
  44. cout<<f/1 <<" moeda(s) de R$ 0,01"<<"\n";
  45.  
  46.  
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement