backup
This commit is contained in:
2
8/.gitingore
Normal file
2
8/.gitingore
Normal file
@@ -0,0 +1,2 @@
|
||||
*.class
|
||||
*.~ava
|
||||
BIN
8/Aufgabe1.class
Normal file
BIN
8/Aufgabe1.class
Normal file
Binary file not shown.
33
8/Aufgabe1.java
Normal file
33
8/Aufgabe1.java
Normal file
@@ -0,0 +1,33 @@
|
||||
import java.io.*;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Aufgabe1 {
|
||||
public static void main(String arrgs[]) { //throws IOException
|
||||
try {
|
||||
FileOutputStream schreib = new FileOutputStream("speicher.txt");
|
||||
|
||||
FileInputStream lies = new FileInputStream("speicher.txt");
|
||||
|
||||
String zeile;
|
||||
int z = 0;
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
zeile = input.next();
|
||||
|
||||
schreib.write(zeile.getBytes(),0,zeile.length()); // Schreibt String zeile in Datei
|
||||
schreib.close();
|
||||
while((z=lies.read())!=-1){ // liest jede Buchstabe als Zahl und umwandelt in char
|
||||
System.out.print((char)z);
|
||||
//lies.close();
|
||||
}
|
||||
lies.close();
|
||||
|
||||
} catch(FileNotFoundException e) {
|
||||
System.out.println("Datei wurde nicht gefunden");
|
||||
} catch (IOException e) {
|
||||
System.out.println("Fehler: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
33
8/Aufgabe1.~ava
Normal file
33
8/Aufgabe1.~ava
Normal file
@@ -0,0 +1,33 @@
|
||||
import java.io.*;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Aufgabe1 {
|
||||
public static void main(String arrgs[]) { //throws IOException
|
||||
try {
|
||||
FileOutputStream schreib = new FileOutputStream("speicher.txt");
|
||||
|
||||
FileInputStream lies = new FileInputStream("speicher.txt");
|
||||
|
||||
String zeile;
|
||||
int z = 0;
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
zeile = input.next();
|
||||
|
||||
schreib.write(zeile.getBytes(),0,zeile.length()); // Schreibt String zeile in Datei
|
||||
schreib.close();
|
||||
while((z=lies.read())!=-1){ // liest jede Buchstabe als Zahl und umwandelt in char
|
||||
System.out.print((char)z);
|
||||
//lies.close();
|
||||
}
|
||||
lies.close();
|
||||
|
||||
} catch(FileNotFoundException e) {
|
||||
System.out.println("Datei wurde nicht gefunden");
|
||||
} catch (IOException e) {
|
||||
System.out.println("Fehler: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
8/Aufgabe3.class
Normal file
BIN
8/Aufgabe3.class
Normal file
Binary file not shown.
28
8/Aufgabe3.java
Normal file
28
8/Aufgabe3.java
Normal file
@@ -0,0 +1,28 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
8/Test.class
Normal file
BIN
8/Test.class
Normal file
Binary file not shown.
28
8/Test.java
Normal file
28
8/Test.java
Normal file
@@ -0,0 +1,28 @@
|
||||
import java.io.*;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Scanner;
|
||||
import java.io.FileOutputStream;
|
||||
public class Test {
|
||||
public static void main(String arrgs[]) throws IOException {
|
||||
//FileOutputStream schreib = new FileOutputStream("speicher.txt");
|
||||
|
||||
FileInputStream lies = new FileInputStream("speicher.txt");
|
||||
|
||||
String zeile;
|
||||
int z = 0;
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
//zeile = input.next();
|
||||
|
||||
//schreib.write(zeile.getBytes(),0,zeile.length());
|
||||
|
||||
//schreib.close();
|
||||
|
||||
while((z=lies.read())!=-1){
|
||||
System.out.print((char)z);
|
||||
}
|
||||
lies.close();
|
||||
}
|
||||
|
||||
}
|
||||
28
8/Test.~ava
Normal file
28
8/Test.~ava
Normal file
@@ -0,0 +1,28 @@
|
||||
import java.io.*;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Scanner;
|
||||
import java.io.FileOutputStream;
|
||||
public class Test {
|
||||
public static void main(String arrgs[]) throws IOException {
|
||||
FileOutputStream schreib = new FileOutputStream("speicher.txt");
|
||||
|
||||
FileInputStream lies = new FileInputStream("speicher.txt");
|
||||
|
||||
String zeile;
|
||||
int z = 0;
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
zeile = input.next();
|
||||
|
||||
schreib.write(zeile.getBytes(),0,zeile.length());
|
||||
|
||||
schreib.close();
|
||||
|
||||
while((z=lies.read())!=-1){
|
||||
System.out.print((char)z);
|
||||
}
|
||||
lies.close();
|
||||
}
|
||||
|
||||
}
|
||||
10
8/speicher.txt
Normal file
10
8/speicher.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
Reference in New Issue
Block a user