#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main() {
int x,y,z,a;
scanf("%d",&x);
for(y = 0;y <= 10x;y++){ //1角
for(z = 0;z <= 5x;z++){
for(a = 0;a <= 210;a++){
if (y10 + z5 + a2 == x*10){
printf("%d个一角%d个两角%d个五角\n",y,z,a);//就是这里
}
}
}
}
}
运行结果
代码不允许发,贴图如下
请用代码块粘贴代码。你这里都有字符被识别成markdown语法然后消失了
代码没问题,用VS运行能够正常换行: