1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> int main(){ int frequency, length; std::cin >> frequency >> length; int R = 1; for (int i=0; i<length; i++) { if (R == 1) std::cout << 'R'; else std::cout << 'W'; if ((i+1) % frequency == 0) R = ~R; } return 0; } |
Direct link: https://paste.plurk.com/show/2321907