C语言题:用一张一元票换1分,2分和5分的硬币,至少各一枚,问有几种换发?我程序怎么错了?#includeint main(void){int a,n,i,sum;printf("Enter a:");scanf("%d",&a);printf("Enter n:");scanf("%d",&n);sum=0;for(i=1;i

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/29 01:06:01
C语言题:用一张一元票换1分,2分和5分的硬币,至少各一枚,问有几种换发?我程序怎么错了?#includeintmain(void){inta,n,i,sum;printf("Entera:"

C语言题:用一张一元票换1分,2分和5分的硬币,至少各一枚,问有几种换发?我程序怎么错了?#includeint main(void){int a,n,i,sum;printf("Enter a:");scanf("%d",&a);printf("Enter n:");scanf("%d",&n);sum=0;for(i=1;i
C语言题:用一张一元票换1分,2分和5分的硬币,至少各一枚,问有几种换发?我程序怎么错了?
#include
int main(void)
{
int a,n,i,sum;
printf("Enter a:");
scanf("%d",&a);
printf("Enter n:");
scanf("%d",&n);
sum=0;
for(i=1;i

C语言题:用一张一元票换1分,2分和5分的硬币,至少各一枚,问有几种换发?我程序怎么错了?#includeint main(void){int a,n,i,sum;printf("Enter a:");scanf("%d",&a);printf("Enter n:");scanf("%d",&n);sum=0;for(i=1;i
#include
int main(void)
{
int i,j,k,s=0; //i为1分硬币,j为2分硬币,k为5分硬币

for(i=1;i