AcWing 653. 钞票
作者:互联网
文章目录
AcWing 653. 钞票
本题链接:AcWing 653. 钞票
本博客给出本题截图:
AC代码
代码:
#include <cstdio>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
printf("%d\n", n);
printf("%d nota(s) de R$ 100,00\n", n / 100);
n %= 100;
printf("%d nota(s) de R$ 50,00\n", n / 50);
n %= 50;
printf("%d nota(s) de R$ 20,00\n", n / 20);
n %= 20;
printf("%d nota(s) de R$ 10,00\n", n / 10);
n %= 10;
printf("%d nota(s) de R$ 5,00\n", n / 5);
n %= 5;
printf("%d nota(s) de R$ 2,00\n", n / 2);
n %= 2;
printf("%d nota(s) de R$ 1,00\n", n);
return 0;
}
后续学完 for
循环可以简化代码
标签:00,de,钞票,nota,653,printf,AcWing 来源: https://blog.csdn.net/qq_52156445/article/details/120468784