CALC fixed by ASAQ

using C=System.Console;class H{static void Main(){for(int c,v=0,o=0,t=0;(c=C.Read())>0;C.Write(c<11?" = "+v+"\n":c<48?" "+(char)c+" ":""+(char)c)){if(c>47)t=t*10+c-48;else{v=o<1?t:o==46?v/t:o>44?v-t:o>42?v+t:o>41?v*t:v;o=c<11?0:c;t=0;}}}}

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

download

return to the top page