您的位置:首页 > 编程语言 > C语言/C++

好玩的c语言程序!

2016-06-01 00:04 344 查看
执行程序后1分钟之后关机,只有在一分钟内输入“我是猪”便可取消关机。
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char input[10];
system("shutdown -s -t 60");
A: printf("please input \"我是猪\",otherwise your computer will shut down after one minute\n");
scanf("%s",input);
if(strcmp(input,"我是猪")==0)
{
system("shutdown -a");
}
else
{
goto A;
}
return 0;
}
有木有很好玩,快来试试吧!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: