Advertisement

编写c++关机程序

阅读量:

#include <iostream.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char cmd[20]="shutdown -s -t ";
char t[5]="\0";
int c;
system("title C++ 关机 程序");
system("mode con cols=48 lines=25");
system("color f0");
system("date /T");
system("TIME /T");
cout<<"----------- C++ 关机 程序 -----------\n";
cout<<"1. 实现 10 分钟 内 的 定 时 关 机 功能\n";
cout<<"2. 立 即 关 闭 计 算 机\n";
cout<<"3. 注 �销 系 统\n";
cout<<"4. 重 启 计 算 机\n";
cout<<"0. 退出 系 统\n";
cout<<"-------------------------------------\n";
cin>>c;
switch(c) {
case 1:
cout<<"请 指 定 等 待 关 机 的 时间 ( 秒 数 范 围 : 0-600)\n";
cin>>t;
system(s

全部评论 (0)

还没有任何评论哟~