Created
January 19, 2017 18:37
-
-
Save KhaledElshamy/7f2446aa04bbcb1a23256e30bd603d20 to your computer and use it in GitHub Desktop.
B. Easter Eggs-codeforces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // working.cpp by Bill Weinman <http://bw.org/> | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| string a="GBIV"; string b; int n; | |
| cin>>n; | |
| if (n<7) | |
| cout<<"Wrong!"; | |
| else cout<<"ROYGBIV"; | |
| n=n-7; | |
| for (int i=1;i<=n/4;i++) | |
| cout<<a; | |
| n=n%4; | |
| b=""; | |
| for (int i=0;i<n;i++) | |
| b=b+a[i]; | |
| cout<<b; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mrebeb