用一元人民币换成一分、两分、五分,编程输出所有兑换方案。相关知识点: 试题来源: 解析 #includemain(){inti,j,k,l=1;for(i=0;i<=20;i++)for(j=0;j<=50;j++){k=100-i*5-j*2;if(k>=0){printf(“%2d%2d%2d”,i,j,k);l=l+1;if(l%5==0)printf(“”);}}} ...
题目用一元人民币换成一分、两分、五分,编程输出所有兑换方案。答案 #includemain(){inti,j,k,l=1;for(i=0;i<=20;i++)for(j=0;j<=50;j++){k=100-i*5-j*2;if(k>=0){printf(“%2d%2d%2d”,i,j,k);l=l+1;if(l%5==0)printf(“”);}}} ...