Symmetric matrix by LeafG

#include <string.h>
int main(void){char t[12][24];gets(t[0]);int i,j,s,n;s=t[0][1]==' '?2:3;n=strlen(t[0])/s+1;for(i=0;i<n-1;i++){for(j=i+1;j<n;j++)strncpy(t[j]+i*s,t[i]+j*s,s);t[j-1][i*s+s-1]=' ';gets(t[i+1]+(i+1)*s);}for(i=0;i<n;i++)puts(t[i]);}

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

download

return to the top page