在电脑上编译能正常运行,洛谷全WA,不知道什么原因,求助各位大佬
查看原帖
在电脑上编译能正常运行,洛谷全WA,不知道什么原因,求助各位大佬
1496405
Hazehacker楼主2024/12/7 11:36

#include<iostream>
#include<vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	int a,cnt =0;
	vector<int> v;
	while (cin >> a) {
		v.push_back(a);
	
	}
	for (int i = 0; i < v.size(); ++i) {
		for (int j = 0; j < v[i]; ++j) {
			if ((i + 1) % 2 != 0) {
				cout << 0; 
			}
			else {
				cout << 1;
			}
			cnt++;
			if (cnt % 7 == 0) {
				cout << "\n";
			}
		}
	}
}
2024/12/7 11:36
加载中...