CPP_Basics_Syntax/第一讲 变量、输入输出、表达式与顺序语句/653.cpp

16 lines
638 B
C++
Raw Permalink Normal View History

2023-03-24 11:51:38 +08:00
#include <cstdio>
int main()
{
int total_money;
scanf("%d", &total_money);
printf("%d\n", total_money);
printf("%d nota(s) de R$ 100,00\n", total_money / 100);
printf("%d nota(s) de R$ 50,00\n", total_money % 100 / 50);
printf("%d nota(s) de R$ 20,00\n", total_money % 100 % 50 / 20);
printf("%d nota(s) de R$ 10,00\n", total_money % 100 % 50 % 20 / 10);
printf("%d nota(s) de R$ 5,00\n", total_money % 100 % 50 % 20 % 10 / 5);
printf("%d nota(s) de R$ 2,00\n", total_money % 100 % 50 % 20 % 10 % 5 / 2);
printf("%d nota(s) de R$ 1,00\n", total_money % 100 % 50 % 20 % 10 % 5 % 2);
return 0;
}