int product; // 未初始化
for (int i = 1; i <= n; i++) {
product *= i;
}
int product = 1;
for (int i = n; i >= 1; i--) { // 錯誤的循環條件
product *= i;
}
unsigned long long product = 1;
for (int i = 1; i <= n; i++) {
if (product > ULLONG_MAX / i) {
printf("Overflow detected!\n");
break;
}
product *= i;
}