|
|
back to boardWhere is my mistake? Posted by ghost 18 May 2002 12:02 #include<stdio.h> void main(void) { char e[80],c; int i,j; i=0; while(i<80) { e[i]=' '; i++; } c=getchar(); i=0; j=0; while(c!=EOF) { switch(c) { case '<':if(i>0) i--;break; case '>':i++; if(i==80) i=0;break; default: e[i]=c; i++;if(i==80) i=0;break; } j++; if(j==80) { c=getchar(); j=0; } c=getchar(); } i=0; while(i<80) { printf("%c",e[i]); i++; } } |
|
|