Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include <cstring>
- using namespace std;
- string a = "red" , b = "blue" , c = "green";
- int main() {
- cout << a << " " << b << " " << c;
- int n;
- cin >> n;
- for(int i = 1; i <= n; i++){
- swap(a, c);
- if(i != 1 && i % 2 == 1){
- swap(a, b);
- }
- }
- cout << endl;
- cout << a << " " << b << " " << c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement