21313번: 문어

문제접근🤔


놓쳤던 부분😅


코드😁


2020 KB

0 ms

#include <iostream>
#include <string>
using namespace std;

int main(void) {
	int n;
	int start = 1;

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	cin >> n;
	while (start <= n) {
		if (start % 2 == 1) {
			if (start == n)
				cout << "3";
			else
				cout << "1 ";
		}
		else
			cout << "2 ";
		start++;
	}
	return (0);
}