- 1
- 2
you left a room for furthor improvement in your code! now it's only 69!
for(;c+=a=getchar()-10;c=a?c-38:printf("%d\n",--c%9+1)*0);
Hi It's a new version of your code only 68 char !!! :D It's works fine. but both versions of your code give Time Limit Exceeded !!! now :|
c;main(a){for(;c+=a=getchar()-10;c=a?c-2:printf("%d\n",--c%9+1)*0);}
N@53R said:
Hi It's a new version of your code only 68 char !!! :D It's works fine. but both versions of your code give Time Limit Exceeded !!! now :|
c;main(a){for(;c+=a=getchar()-10;c=a?c-2:printf("%d\n",--c%9+1)*0);}
there is just a small mistake you made, when the user inputs "0\n" you first read "0". in your code after first iteration variable c will be equal to 36 (while in mine, it's 0). then you read "\n" and the result of the assignment will become 36. it's not 0 so the for will continue, and your program does not exit.
In order to post something you must login first. You can use the form in the top of this page.