EasterEggs(15)-B class
jackoup
c_cpp
a year ago
435 B
3
Indexable
CodeForces
#include <iostream> using namespace std; void fio() { ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); } int main() { fio(); int n;cin>>n; string colors = "ROYGBIV"; if(n == 7){ cout<< colors; return 0; } int index = 0; for(int i =0;i<n;i++,index++) { cout<<colors[index]; if(index == 6){ index = 2; } } return 0; }
Editor is loading...
Leave a Comment