backup
This commit is contained in:
30
8/Aufgabe3.~ava
Normal file
30
8/Aufgabe3.~ava
Normal file
@@ -0,0 +1,30 @@
|
||||
import java.io.*;
|
||||
import java.util.Scanner;
|
||||
public class Aufgabe3 {
|
||||
public static void main(String arrgs[]) {
|
||||
try {
|
||||
Scanner input = new Scanner(System.in);
|
||||
FileOutputStream schreib = new FileOutputStream("speicher.txt");
|
||||
|
||||
|
||||
String zeile;
|
||||
|
||||
|
||||
|
||||
|
||||
for (int i = 0;i <10 ;i++ ) {
|
||||
zeile = input.next();
|
||||
zeile += '\n';
|
||||
schreib.write(zeile.getBytes(),0,zeile.length());
|
||||
}
|
||||
|
||||
|
||||
schreib.close();
|
||||
} catch(FileNotFoundException e) {
|
||||
System.out.println("Datei wurde nicht gefunden");
|
||||
} catch (IOException e) {
|
||||
System.out.println("Fehler: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user