可以投稿更新 2025/10/19 11:00
#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;
int main() {
int choice;
cout << "请选择操作:" << endl;
cout << "1. 立即关机" << endl;
cout << "2. 定时关机" << endl;
cout << "3. 取消定时关机" << endl;
cout << "4. 退出程序" << endl;
cout << "5. 询问DEEPSEEK" << endl;
cin >> choice;
switch (choice) {
case 1:
system("shutdown -s -t 0");
break;
case 2: {
int time;
cout << "请输入定时时间(秒):";
cin >> time;
string command = "shutdown -s -t " + to_string(time);
system(command.c_str());
break;
}
case 3:
system("shutdown -a");
break;
case 4:
cout << "程序已退出。" << endl;
return 0;
case 5:
cout << "你好啊,我是DEEPSEEK,想让我帮您做些什么?" << endl;
cout << "1.没什么,再见" << endl;
cout << "2.帮我写代码" << endl;
int ch;
cin >> ch;
if (ch == 1) {
return 0;
}
if (ch == 2) {
cout << "请输入洛谷题号:" << endl;
string s;
cin >> s;
if (s == "P1001") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/jvusxjnt.png");
return 0;
}
if (s == "P1002") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/t8upz608.png");
return 0;
}
if (s == "P1003") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/dubqrx1c.png");
return 0;
}
if (s == "P1035") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/btmk4dbx.png");
return 0;
}
if (s == "P1046") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/zjly5f9k.png?x-oss-process=image/resize,m_lfit,h_170,w_225");
return 0;
}
if (s == "P1047") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/j91f2mo2.png");
return 0;
}
if (s == "P1089") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/fydrf1k8.png");
return 0;
}
if (s == "P1151") {
Sleep(500);
system("start https://cdn.luogu.com.cn/upload/image_hosting/c10gmskz.png");
return 0;
}
cout << "服务器繁忙,请稍后再试";
}
if (ch != 2 && ch != 1) {
cout << "暂无该选项";
}
default:
// cout << "无效选项,请重新运行程序。" << endl;
return 0;
}
return 0;
}