Skip to content

Commit fe55fe3

Browse files
committed
implement solution
1 parent 8e55ee8 commit fe55fe3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Exercise.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import java.util.Scanner;
2+
13
public class Exercise {
24

35
public static void main(String[] args) {
4-
// implement exercise here
6+
@SuppressWarnings("resource")
7+
Scanner sc = new Scanner(System.in);
8+
9+
System.out.print("Gib bitte einen Wert zwischen -1 und -32.768 ein: ");
10+
short s = sc.nextShort();
11+
12+
System.out.println("Ergebnis: Der vorzeichenfreie Dezimalwert betraegt " + Short.toUnsignedInt(s));
513
}
614
}

0 commit comments

Comments
 (0)