《补题》(牛客:清楚姐姐的三角形II)

66 阅读1分钟

思维

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n;
	cin >> n;

	int a[3] = {1, 1, 2};
	int i = 0;
	while (n --) {
		cout << a[i ++] << ' ';
		if (i == 3) i = 0;
	}
	cout << endl;
	
	return 0;
}