File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,39 @@ public class c1038 {
11
11
System .out .printf ("%.0f ", a +b );
12
12
}
13
13
}
14
+
15
+ // ์ด๋ ๊ฒ ์ ๊ทผํ์ผ๋ ๋๋ฌด ์ข์ OpenSource๋ฅผ ๋ฐ๊ฒฌํด ์ ์ด๋ณธ๋ค
16
+
17
+ ๐ก๐ก
18
+ package codeup ;
19
+
20
+ import java .util .Scanner ;
21
+
22
+ public class c1038 {
23
+ Scanner sc = new Scanner (System .in ); // Scanner ๊ฐ์ฒด ์์ฑ
24
+
25
+ // ๋ฒ์ : -1073741824 ~ 1073741824
26
+ System .out .print ("์ฒซ๋ฒ์งธ ์ ์ ์
๋ ฅ : ");
27
+ long num1 = sc .nextLong ();
28
+ long num2 = 0 ;
29
+
30
+ if ( num1 < -1073741824 || num1 > 1073741824 ) { // num1์ด ๋ฒ์ ๋ฐ
31
+ System .out .println ("๋ฒ์ ์์ ์ ์๋ฅผ ์
๋ ฅํด์ฃผ์ธ์ .");
32
+
33
+ }else { // num1์ด ๋ฒ์ ๋ด
34
+ System .out .print ("๋๋ฒ์งธ ์ ์ ์
๋ ฅ: " );
35
+ num2 = sc .nextLong ();
36
+
37
+ if ( num2 < -1073741824 || num2 > 1073741824 ) { // num2์ด ๋ฒ์ ๋ฐ
38
+ System .out .println ("๋ฒ์ ์์ ์ ์๋ฅผ ์
๋ ฅํด์ฃผ์ธ์." );
39
+
40
+ }else {
41
+ sc .close ();
42
+ long sum = num1 + num2 ;
43
+ System .out .println (sum );
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+
You canโt perform that action at this time.
0 commit comments