![:evil:](./images/smilies/icon_evil.gif)
But I don't understand why I get WA, so I put both of em in Notepad++ and the only diference was the End of Line chars.
My C version always made ETX+LF, and the Java one only CR... So I tried, lots of time lost, but I finally managed to duplicate it in Java. I managed to, as the pic proves :
![Image](http://img.photobucket.com/albums/v331/MetaBrain/RANDOM%202/filematch.jpg)
My Java code :
Code: Select all
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
*/
/**
* @author Daniel
*
*/
public class Main {
// static File file = new File("lol.txt") ;
// static File fileout = new File("out.txt") ;
static Scanner in = new Scanner(System.in);
// static PrintWriter output ;//= new PrintWriter(fileout) ;
static PrintWriter output = new PrintWriter(new BufferedOutputStream(System.out));
public static void main(String[] args) throws FileNotFoundException {
// in = new Scanner(file) ;
// output = new PrintWriter(fileout);
while(in.hasNextLine()) {
char[] line = in.nextLine().toCharArray() ;
for(int i = 0 ; i<line.length ; i++) {
output.append((char)(line[i]-7)) ;
}
if(in.hasNext()) {
output.append((char)3);
}
output.append("\n");
output.flush();
}
output.flush();
}
}
So, where I'm I failing? Solving problems in Java is always such a headache... Oh well...