This commit is contained in:
Mykola Fesenko
2025-07-29 09:05:07 +02:00
parent ce8e5eb3fe
commit 721931ac60
68 changed files with 608 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import java.util.Scanner;
public class Eingabe {
public static void main(String args[]){
Scanner eingabe = new Scanner(System.in);
System.out.print("Bitte eine ganze Zahl eingeben: ");
if(eingabe.hasNextInt()){
int zahl = eingabe.nextInt();
System.out.println("Das Quadrat von " + zahl + " ist " + (zahl * zahl));
}
else {
System.out.println("Bitte nur ganze Zahlen eingeben!!");
}
}
}