Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- *
- * @author Moraisen
- */
- public class Main {
- public static void main (String[] args) {
- System.out.println("Gib die richtige Zahl ein");
- Scanner sc = new Scanner(System.in);
- String eingabe = sc.nextLine();
- int wert;
- try {
- wert = Integer.parseInt(eingabe);
- }catch (Exception exc) {
- System.out.println("Bitte nur Zahlen eingeben");
- return;
- }
- int i = 5;
- if (wert == 5)
- {
- System.out.println("KOOREEKCT");
- }
- else if (wert>5)
- {
- System.out.println("Wert zu groΓ");
- }else if (wert<5) {
- System.out.println("Wert zu klein");
- }
- }
- public static void main1 (String[] args) {
- System.out.println("Gib das Passwort ein!");
- Scanner sc = new Scanner(System.in);
- String zeile = sc.nextLine();
- if (zeile.equals("PENIS")) {
- System.out.println("Richtig!");
- }else {
- System.out.println("Falsch, geh Simons Popcorn klauen, dann geb ichs dir");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement