跳到正文

剪贴板

剪贴板 j8xdwycz

原文
剪贴板信息

剪贴板信息

收录
更新

优秀的代码

vector

C++
#include<bits/stdc++.h>
using namespace std;

vector<int> v;
int x;
void go(){while(1)v.push_back(x++);}

int main(){
	go();
	return 0;
}

时间戳

C++
#include<bits/stdc++.h>
using namespace std;

int main(){
	long long st,ed,sc;
	sc=10;//秒数
	st=time(0);
	while(1){
		ed=time(0);
		if(ed-st==sc){
			puts("go\n");//do sth
			break;
		}
	}
	return 0;
}

综合应用 11 :

C++
#include<bits/stdc++.h>
using namespace std;

vector<int> v;
int x;
void go(){while(1)v.push_back(x++);}

int main(){
	long long st,ed,sc;//秒数
	sc=10;
	st=time(0);
	while(1){
		ed=time(0);
		if(ed-st>=sc){
			puts("go\n");//do sth
			go();
			break;
		}
	}
	return 0;
}