#include<iostream> #include<string.h> void t(char *b,char c,int p){b[p]=c;std::cout<<b<<"\n";} main(){char B[100],*b=" | | \n",*l="---+---+---\n";strcpy(B,b);strcat(B,l);strcat(B,b);strcat(B,l);strcat(B,b);t(B,'X',1);t(B,'O',29);t(B,'X',57);t(B,'O',9);t(B,'X',49);t(B,'O',53);t(B,'X',25);}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).