c语言学习历程——给定条件的整数集
1 #include <stdio.h> 2 3 4 int main() { 5 int a; 6 int i, j, k; 7 int count = 0; 8 9 scanf_s("%d", &a); 10 11 i = a; 12 13 while (i <= a + 3) { 14 j = a; 15 while (j <= a + 3) { 16 k = a; 17 while (k <= a + 3) { 18 if (i != j && j != k && i != k) { 19 printf("%d%d%d", i, j, k); 20 count++; 21 if (count != 0 && count % 6 == 0) { 22 printf("\n"); 23 } else { 24 printf(" "); 25 } 26 } 27 k++; 28 } 29 j++; 30 } 31 i++; 32 } 33 }