AcWing 653. 钞票
原题链接
简单
还有二元的?
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int number=0,i=0;
int money[7]={1,2,5,10,20,50,100};
int count[7]={0};
cin>>number;
cout <<number<<endl;
for(i=0;i<7;i++){
count[i]=number/money[6-i];
number=number%money[6-i];
}
cout << count[0] << " nota(s) de R$ 100,00" << endl;
cout << count[1] << " nota(s) de R$ 50,00" << endl;
cout << count[2] << " nota(s) de R$ 20,00" << endl;
cout << count[3] << " nota(s) de R$ 10,00" << endl;
cout << count[4] << " nota(s) de R$ 5,00" << endl;
cout << count[5] << " nota(s) de R$ 2,00" << endl;
cout << count[6] << " nota(s) de R$ 1,00" << endl;
return 0;
}