Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
18
Task/Integer-overflow/Java/integer-overflow.java
Normal file
18
Task/Integer-overflow/Java/integer-overflow.java
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
public class integerOverflow {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Signed 32-bit:");
|
||||
System.out.println(-(-2147483647-1));
|
||||
System.out.println(2000000000 + 2000000000);
|
||||
System.out.println(-2147483647 - 2147483647);
|
||||
System.out.println(46341 * 46341);
|
||||
System.out.println((-2147483647-1) / -1);
|
||||
System.out.println("Signed 64-bit:");
|
||||
System.out.println(-(-9223372036854775807L-1));
|
||||
System.out.println(5000000000000000000L+5000000000000000000L);
|
||||
System.out.println(-9223372036854775807L - 9223372036854775807L);
|
||||
System.out.println(3037000500L * 3037000500L);
|
||||
System.out.println((-9223372036854775807L-1) / -1);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue