爆零,求助!

P4327 [COCI2006-2007#1] Okviri

```cpp #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.length(); i++) { if ((i + 1) % 3 != 0) { cout << "..#."; } else { cout << "..*."; } } cout << "." << endl; for (int i = 0; i < s.length(); i++) { if ((i + 1) % 3 != 0) { cout << ".#.#"; } else { cout << ".*.*"; } } cout << "." << endl; for (int i = 0; i < s.length(); i++) { if ((i + 1) % 3 != 0 && i % 3 != 0) { cout << "#." << s[i] << "."; } else if (i == 0) { cout << "#." << s[i] << "."; } else { cout << "*." << s[i] << "."; } } if (s.length() % 3 != 0) { cout << "#" << endl; } else { cout << "*" << endl; } for (int i = 0; i < s.length(); i++) { if ((i + 1) % 3 != 0) { cout << ".#.#"; } else { cout << ".*.*"; } } cout << "." << endl; for (int i = 0; i < s.length(); i++) { if ((i + 1) % 3 != 0) { cout << "..#."; } else { cout << "..*."; } } cout << "." << endl; return 0; } 、、、
by 八爷 @ 2022-11-06 09:55:13


希望对你有帮助
by 八爷 @ 2022-11-06 09:56:05


|