In windows, "\r\n" means new line while "\n" in Linux
Because of that, At first time I got some of [WA] signal when I posted my JAVA program.
In Windows, I have to change readln() just like this
[java]while(lg<len)
{
car=System.in.read();
if(lg==0&&(car=='\r')||(car=='\n')) continue;
if((car<0)||(car=='\r')||(car=='\n')) break;
lin[lg++]+=car;
}
[/java]
But in Linux and Online judge, that code produced [WA], and I have to change to original readln().
Is there any way to make these change automacally?
Very annoying difference between Windows and Linux
Moderator: Board moderators