80求助,4,5会WA

P1319 压缩技术

duanyuchen @ 2018-05-19 20:17:50

输出到最后面时候

include就不输出了<iostream>

using namespace std; int b[500]; int main() { int n; cin >> n; for (int i = 0; i < 2 n; i++) { cin >> b[i]; } int t = 0; for (int i = 0; i < 2 n; i++) { if (i % 2 == 0) { while (b[i]--) { if (t == n) { cout << endl; t = 0; } cout << 0; t++; } } else { while (b[i]--) { if (t == n) { cout << endl; t = 0; } cout << 1; t++; } }

}
return 0;

}


|