README.md 450 字节
Newer Older
1 2 3 4
```cpp
#include<thread>
#include<bits/stdc++.h>
using namespace std;
6
UPDATE  
64104061f23fda247c679fa8 已提交
5

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
inline void solve() {
	for (int i = 0; i < 20; ++i)cout << "fffff\n";
	cout << flush;
}
inline void solve2() {
	for (int i = 0; i < 20; ++i)cout << "eeeee" << endl;
	cout << flush;
}
int main() {
	thread t1(solve);
	thread t2(solve2);
	th1.join(); // 必须将线程join或者detach 等待子线程结束主进程才可以退出
	th2.join();
	cout<<"up is main";
	return 0;
}

```