29 lines
965 B
Java
29 lines
965 B
Java
import java.io.*;
|
|
|
|
public class Questionnaire
|
|
{
|
|
public static void main(String[] args)
|
|
{
|
|
try{
|
|
BufferedReader Questionner = new BufferedReader(new InputStreamReader("java.quiz",false));
|
|
BufferedReader listen = new BufferedReader(new InputStreamReader(System.in));
|
|
BufferedWriter addrep = new BufferedWriter(new FileWriter("reponses.txt"));
|
|
BufferedWriter erased = new BufferedWriter (new FileWriter("reponses.txt",false));
|
|
if(listen.readLine() != null)
|
|
{
|
|
erased.write("");
|
|
erased.close();
|
|
}
|
|
while(Questionner.readLine()){
|
|
System.out.println();
|
|
addrep.write(listen.readLine().trim());
|
|
}
|
|
addrep.write(listen.readLine().trim());
|
|
addrep.close();
|
|
}catch(IOException e){
|
|
System.err.println(e.getMessage());
|
|
}catch(NumberFormatException e){
|
|
System.out.println("erreur");
|
|
}
|
|
}
|
|
} |