kkglove's blog

By kkglove, 14 years ago, In English

include

using namespace std; string a="GBIV"; string b; int n; int main() { 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; }

Full text and comments »

  • Vote: I like it
  • -24
  • Vote: I do not like it