问题遇到的现象和发生背景
给定不超过6的正整数A,考虑从A开始的连续4个数字,请输出所有由这四个数字组成的无重复数字的三位数。
问题相关代码,请勿粘贴截图
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int a,b;
scanf("%d",&a);
int i,j,k;
b = 0;
i = a;
while (i <= a+3){
j = a;
while(j <= a+3){
k = a;
while(k <= a+3){
if(i!=j){
if(j!=k){
if(i!=k){
b++;
printf("%d%d%d",i,j,k);
if (b == 6){
printf("\n");
b = 0;
}else{
printf(" ");
}
}
}
}
}
k++;
}
j++;
}
i++;
}
return 0;
}
运行结果及报错内容
报错:excepted identifier or '('before 'return'
excepted identifier or '('before ')'token
recipe for target'main.o'failed