#include <stdio.h> int main(){ int n; int num; int count=0; if (scanf("%d",&n)!=EOF){ // 计算150,分配给5,2,1,总数得是100 for (int i=n;i<n+4;i++){ for (int j=n;j<n+4;j++){ for (int m=n;m<n+4;m++){ if (i!=j && j!=m && i!=m){ count++; num = 100*i+10*j+m; if (count>0 && count%6==1){printf("%d",num);} else{printf(" %d",num);} if (count>0 && count%6==0){printf("\n");} } } } } } else{ printf("input wrong"); } return 0; }