AcWing 653. 钞票
原题链接
中等
作者:
夏旭日
,
2020-10-23 09:23:04
,
所有人可见
,
阅读 289
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int number, origin_number;
int result;
int coin_100, coin_50, coin_20, coin_10, coin_5, coin_2, coin_1;
cin >> number;
origin_number = number;
coin_100 = number / 100;
result = number % 100;
number = result;
coin_50 = number / 50;
result = number % 50;
number = result;
coin_20 = number / 20;
result = number % 20;
number = result;
coin_10 = number / 10;
result = number % 10;
number = result;
coin_5 = number / 5;
result = number % 5;
number = result;
coin_2 = number / 2;
result = number % 2;
coin_1 = result;
cout << origin_number <<endl;
cout << coin_100 << " nota(s) de R$ 100,00" <<endl;
cout << coin_50 << " nota(s) de R$ 50,00" << endl;
cout << coin_20 << " nota(s) de R$ 20,00" << endl;
cout << coin_10 << " nota(s) de R$ 10,00" << endl;
cout << coin_5 << " nota(s) de R$ 5,00" << endl;
cout << coin_2 << " nota(s) de R$ 2,00" << endl;
cout << coin_1 << " nota(s) de R$ 1,00" << endl;
return 0;
}