奇怪的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(); } }