#include <stdio.h> #include <stdlib.h> int main() { int i, j, k; int count = 0; int number; for (i = 1; i <= 4; i++) { for (j = 1; j <= 4; j++) { for (k = 1; k <= 4; k++) { if (i != j&&i != k&&j != k)//確定沒有相同數字 { count++; number = 100 * i + 10 * j + k; printf("%5d", number); } } } } printf("\n"); printf("count=%d\n", count); system("pause"); return 0; }