simple rainbow by potato

#include<bits/stdc++.h>
#define f(n)for(int i=0;i<n;i++)
#define c(n)std::cout<<n;
main(){int n,m;char p=' ';std::cin>>n;m=2*n;f(n)c(p)f(2*n)c("R")c("\n")f(n-1)c(p)c("R")f(2*n)c("G")c("R\n")f(n-2)c(p)std::string s(n-3,p),t(m,p),b(m,'B'),q(2,p);c("RG"+b+"GR\n")s+="RGB";c(s+t+"BGR\n");f(n-3){s.erase(0,1);t+=q;c(s+t+"BGR\n");}c("GB"+t+q+"BG\nB"+t+q+q+"B");}

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

download

return to the top page