Advertisement
askarulytarlan

ацу

Nov 25th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <string.h>
  4. #include <cstring>
  5.  
  6. using namespace std;
  7.  
  8. string a = "red" , b = "blue" , c = "green";
  9.  
  10. int main() {
  11. cout << a << " " << b << " " << c;
  12. int n;
  13. cin >> n;
  14. for(int i = 1; i <= n; i++){
  15. swap(a, c);
  16. if(i != 1 && i % 2 == 1){
  17. swap(a, b);
  18. }
  19. }
  20. cout << endl;
  21. cout << a << " " << b << " " << c;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement