int a,b,c,i;for(a=0;a<10;a++)for(b=0;b<5;b++)for(c=0;c<2;c++)if(a*10+b*20+c*50==100) {printf("可换成%d张10元%d张20元 %d张50元\n",a,b,c);i++;}printf("有%d中换法\n",i); 20210311
#include<stdio.h>int main(){ int i, j, k, cnt = 0; for (i = 0; i <= 10; i ++) for (j = 0; j <= 10; j += 2) for (k = 0; k <= 10; k +=5) if (i + j + k == 10) cnt ++; printf(&quo...
你程的问1.i和g这两个循环控制变量要先才能使用。2.count的值为0而不是1。3.a*i+b*g == 1点数不能用==和!=来比较。帮你改了。#include<stdio.h>int main(){ int a, b, i, j, count;a = 1; b = 5; count = 0; for (i = 1; i <= 10; i++) { for ( j ...