simple rainbow by RayZ

using C=System.Console;class s{static void Main(){int n=int.Parse(C.ReadLine());w(m(' ',n)+m('R',n*2));w(m(' ',n-1)+'R'+m('G',n*2)+'R');w(m(' ',n-2)+"RG"+m('B',n*2)+"GR");for(int i=0;i<n-2;i++)w(m(' ',n-3-i)+"RGB"+m(' ',2*(i+n))+"BGR");w("GB"+m(' ',4*n-4)+"BG");w('B'+m(' ',4*n-2)+'B');}static void w(string s){C.WriteLine(s);}static string m(char c,int n){return new string(c,n);}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page