1 #include <stdio.h> 2 3 int main () 4 { 5 int f; // 1分钱 6 int j; // 5角钱 7 int k; // 10块钱 8 int y; // 25元钱 9 int temp, left; // 临时的变量与剩余 10 11 printf("分别输入25元钱、10块钱、5角钱和1分钱的数目: "); 12 scanf("%d %d %d %d", &y, &k, &j, &f); 13 14 left = 25 * y + 10 * k + 5 * j + f; 15 16 printf("你的收藏值得\n "); 17 18 temp = left / 100; 19 printf("\n%d 1分钱", temp); 20 left = left % 100; 21 22 temp = left / 25; 23 printf("\n%d 5角钱", temp); 24 left = left % 25; 25 26 temp = left / 10; 27 printf("\n%d 10块钱", temp); 28 left = left % 10; 29 30 temp = left / 5; 31 printf("\n%d 25元钱", temp); 32 left = left % 5; 33 34 printf("\n剩余 %d\n", left); 35 }