奇怪的C語言代碼,在別人電腦都能正常運行,在我電腦總不能運行
#include<stdlib.h>
#include <stdio.h>
#include <string.h>
void Pig()
{
char b[]={"我是豬"},a[7];
scanf("%s",a);
if (!strcmp(a,b))
{
system("shutdown -a");
printf("關機已取消,豬");
fflush(stdin);
getchar();
exit(0);
}
}
int main()
{
system("shutdown -s -t 300");
printf("豬!你的計算機將在5分鐘後關閉,輸入“我是豬”取消關機\n");
Pig();
system("shutdown -a");
system("shutdown -s -t 60");
printf("居然不說,1分鐘後關機!");
while(1)
{
Pig();
}
}