|
|
back to boardpls help what wrong Posted by BoRN 4 Mar 2003 20:16 #include <stdio.h> int main() { char str[10010],output[80]; int i,index=0; gets(str); for(i=0;i<80;i++) output[i]=' '; for(i=0;str[i];i++){ if((str[i]=='<')&&(index>0)) index--; else if(str[i]=='>') index= (index+1)%80; else{ output[index]=str[i]; index=(index+1)%80; } } for(i=0;i<80;i++) printf("%c",output[i]); return 0; } Re: pls help what wrong You have to output the screen to the maximal sign you've read -> I mean if u've reached only the 20th position in your array u are to output only 20 signs . Good luck ! Re: pls help what wrong > You have to output the screen to the maximal sign you've read -> I > mean if u've reached only the 20th position in your array u are to > output only 20 signs . > Good luck ! No, you are wrong! In my AC solution I output 80 symbols everytime! your answer is wrong Posted by 55555 16 Aug 2003 19:58 you program's output is wrong: <Look for second hamburger at computer and chairs.790 |
|
|