Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define fori(i,n) for(int i=0;i<n;i++)
- #define foris(i,s,n) for(int i=s;i<n;i++)
- using namespace std;
- const double pi=3.14159;
- int may(int a,int b){
- return (a+b+abs(a-b))/2;}
- double dist(double x1,double y1,double x2,double y2){
- return pow(pow((x2-x1),2)+pow((y2-y1),2),1/2.0);}
- int main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- double k;
- cin>>k;
- double f,i;
- f=modf(k,&i);
- f=f*100.00;
- cout<<"NOTAS:"<<"\n";
- cout<<(int)i/100 <<" nota(s) de R$ 100,00"<<"\n";
- i=fmod(i,100);
- cout<<(int)i/50 <<" nota(s) de R$ 50,00"<<"\n";
- i=fmod(i,50);
- cout<< (int)i/20<<" nota(s) de R$ 20,00"<<"\n";
- i=fmod(i,20);
- cout<< (int)i/10<<" nota(s) de R$ 10,00"<<"\n";
- i=fmod(i,10);
- cout<<(int)i/5 <<" nota(s) de R$ 5,00"<<"\n";
- i=fmod(i,5);
- cout<<(int)i/2 <<" nota(s) de R$ 2,00"<<"\n";
- i=fmod(i,2);
- cout<<"MOEDAS:\n";
- cout<<(int)i/1.00 <<" moeda(s) de R$ 1,00"<<"\n";
- cout<<(int)f/50 <<" moeda(s) de R$ 0,50"<<"\n";
- f=fmod(f,50);
- cout<<(int)f/25 <<" moeda(s) de R$ 0,25"<<"\n";
- f=fmod(f,25);
- cout<<(int)f/10 <<" moeda(s) de R$ 0,10"<<"\n";
- f=fmod(f,10);
- cout<<(int)f/5<<" moeda(s) de R$ 0,05"<<"\n";
- f=fmod(f,5);
- cout<<f/1 <<" moeda(s) de R$ 0,01"<<"\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement