Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

ย 

History

History
History
52 lines (36 loc) ยท 1.12 KB

File metadata and controls

52 lines (36 loc) ยท 1.12 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package codeup;
import java.util.Scanner;
public class c1038 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double a = sc.nextInt();
double b = sc.nextInt();
System.out.printf("%.0f", a+b);
}
}
// ์ด๋ ‡๊ฒŒ ์ ‘๊ทผํ–ˆ์œผ๋‚˜ ๋„ˆ๋ฌด ์ข‹์€ OpenSource๋ฅผ ๋ฐœ๊ฒฌํ•ด ์ ์–ด๋ณธ๋‹ค
๐Ÿ’ก๐Ÿ’ก
package codeup;
import java.util.Scanner;
public class c1038 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in); // Scanner ๊ฐ์ฒด ์ƒ์„ฑ
// ๋ฒ”์œ„ : -1073741824 ~ 1073741824
System.out.print("์ฒซ๋ฒˆ์งธ ์ •์ˆ˜ ์ž…๋ ฅ: ");
long num1 = sc.nextLong();
long num2 = 0;
if( num1 < -1073741824 || num1 > 1073741824 ) { // num1์ด ๋ฒ”์œ„ ๋ฐ–
System.out.println("๋ฒ”์œ„ ์•ˆ์˜ ์ •์ˆ˜๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.");
}else{ // num1์ด ๋ฒ”์œ„ ๋‚ด
System.out.print("๋‘๋ฒˆ์งธ ์ •์ˆ˜ ์ž…๋ ฅ: ");
num2 = sc.nextLong();
if( num2 < -1073741824 || num2 > 1073741824 ) { // num2์ด ๋ฒ”์œ„ ๋ฐ–
System.out.println("๋ฒ”์œ„ ์•ˆ์˜ ์ •์ˆ˜๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.");
}else{
sc.close();
long sum = num1 + num2;
System.out.println(sum);
}
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.