#include <stdio.h>
int main(void) {
int x,y,z,s,f;
printf("请用户输入美金数目:\n");
scanf_s("%d", &x);
y = x / 20;
z = x % 20 / 10;
s = x % 20 % 10 / 5;
f = x % 20 % 10 % 5 ;
printf("%d,%d,%d,%d", y, z, s, f);
system("pause");
return 0;
}
#include <stdio.h> int main(void) { int x,y,z,s,f; printf("请用户输入美金数目:\n"); scanf_s("%d", &x); y = x / 20; z = x % 20 / 10; s = x % 20 % 10 / 5; f = x - 20 * y - 10 * z - 5 * s; printf("%d,%d,%d,%d", y, z, s, f); system("pause"); return 0; }