#include <bits/stdc++.h> using namespace std; vector<string> vec(100); int main(){ ios_base::sync_with_stdio(0); cin.tie(0); string even="1"; for (int i = 0; i<99; i++)even+='0'; string odd; for (int i = 0; i<99; i++)odd+='1'; odd+='0'; cout << '0'; for (int i = 0; i<99; i++)cout<<'1'; cout << '\n'; for (int i = 2; i<=100; i++){ if (i&1)cout << odd << '\n'; else cout << even << '\n'; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include <bits/stdc++.h> using namespace std; vector<string> vec(100); int main(){ ios_base::sync_with_stdio(0); cin.tie(0); string even="1"; for (int i = 0; i<99; i++)even+='0'; string odd; for (int i = 0; i<99; i++)odd+='1'; odd+='0'; cout << '0'; for (int i = 0; i<99; i++)cout<<'1'; cout << '\n'; for (int i = 2; i<=100; i++){ if (i&1)cout << odd << '\n'; else cout << even << '\n'; } } |