好玩的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; }
有木有很好玩,快来试试吧!
相关文章推荐
- C语言求解素数(质数)的优化:打印100-200之间的素数
- 编写C语言程序求两个数的最大公约数
- 图的创建,深度优先遍历,广度优先遍历。
- 浅谈C++中内存分配、函数调用和返回值问题
- 关于c++中运算符的总结
- C++转移构造函数与转移赋值函数
- C++对象的构造
- C++连接数据库
- C/C++关键字 new/delete和malloc/free
- C语言的函数(第二篇章:函数的传值与传址)
- C++ 中int,char,string,CString类型转换(一)
- c语言函数笔记19之函数3
- C++中模板的特化与偏特化
- 有限状态机与行为树的C++学习与实践sudo apt-get install libxmu-dev sudo apt-get install libxmu-dev libxi-dev
- c++
- Thinking in c++ 第三章
- 一起talk C栗子吧(第一百六十一回:C语言实例--套接字通信模型二)
- C语言中的定义和声明的区别
- leetcode_c++:Insert Intervals(057)
- Ubuntu下配置和编译cpp-ethereum客户端