新手啊,帮忙看看哪错了是求工资的问题,有100,50,20,10,5,2,1元的钱求发最少张数,#include#includemain(){int a,s,d,f,g,h,j,n;scanf("%d",&n);a=n/100;n%=100;s=(n-100*a)/50;n%=100;d=(n-100*a-50*s)/20;n%=100;f=(n-100*a-50*s-20*d)/10;n
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/31 07:36:29
新手啊,帮忙看看哪错了是求工资的问题,有100,50,20,10,5,2,1元的钱求发最少张数,#include#includemain(){int a,s,d,f,g,h,j,n;scanf("%d",&n);a=n/100;n%=100;s=(n-100*a)/50;n%=100;d=(n-100*a-50*s)/20;n%=100;f=(n-100*a-50*s-20*d)/10;n
新手啊,帮忙看看哪错了
是求工资的问题,有100,50,20,10,5,2,1元的钱求发最少张数,
#include
#include
main()
{int a,s,d,f,g,h,j,n;
scanf("%d",&n);
a=n/100;n%=100;
s=(n-100*a)/50;n%=100;
d=(n-100*a-50*s)/20;n%=100;
f=(n-100*a-50*s-20*d)/10;n%=100;
g=(n-100*a-50*s-20*d-10*f)/5;n%=100;
h=(n-100*a-50*s-20*d-10*f-5*g)/2;n%=100;
j=(n-100*a-50*s-20*d-10*f-5*g-2*h)/1;n%=100;
printf("一百元的有%d\n",a);
printf("五十元的有%d\n",s);
printf("二十元的有%d\n",d);
printf("十元的有%d\n",f);
printf("五元的有%d\n",g);
printf("二元的有%d\n",h);
printf("一元的有%d\n",j);
system("pause");
}
新手啊,帮忙看看哪错了是求工资的问题,有100,50,20,10,5,2,1元的钱求发最少张数,#include#includemain(){int a,s,d,f,g,h,j,n;scanf("%d",&n);a=n/100;n%=100;s=(n-100*a)/50;n%=100;d=(n-100*a-50*s)/20;n%=100;f=(n-100*a-50*s-20*d)/10;n
/*
1653
一百元的有16
五十元的有1
二十元的有0
十元的有0
五元的有0
二元的有1
一元的有1
请按任意键继续...
*/
#include <stdio.h>
#include <stdlib.h>
int main() {
\x05int a,s,d,f,g,h,n;
\x05scanf("%d",&n);
\x05a = n/100;n %= 100; // a为100元张数
\x05s = n/50; n %= 50; // s为50元张数
\x05d = n/20; n %= 20; // d为20元张数
\x05f = n/10; n %= 10; // f为10元张数
\x05g = n/5; n %= 5;
\x05h = n/2; n %= 2;
\x05printf("一百元的有%d\n",a);
\x05printf("五十元的有%d\n",s);
\x05printf("二十元的有%d\n",d);
\x05printf("十元的有%d\n",f);
\x05printf("五元的有%d\n",g);
\x05printf("二元的有%d\n",h);
\x05printf("一元的有%d\n",n);
\x05system("pause");
\x05return 0;
}