We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e55ee8 commit 9540d07Copy full SHA for 9540d07
1 file changed
Exercise.java
@@ -1,6 +1,19 @@
1
+import java.util.Scanner;
2
+
3
public class Exercise {
4
5
public static void main(String[] args) {
- // implement exercise here
6
+ @SuppressWarnings("resource")
7
+ Scanner sc = new Scanner(System.in);
8
9
+ System.out.print("Gib bitte eine ganze Zahl ein: ");
10
+ int a = sc.nextInt();
11
12
+ System.out.print("Gib bitte eine weitere ganze Zahl ein: ");
13
+ int b = sc.nextInt();
14
15
+ double c = (a * 100.0) / b;
16
17
+ System.out.println("Ergebnis: " + a + " von " + b + " sind " + c + "%");
18
}
19
0 commit comments