-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBJ2908.java
More file actions
45 lines (25 loc) · 885 Bytes
/
Copy pathBJ2908.java
File metadata and controls
45 lines (25 loc) · 885 Bytes
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
package baekjoon;
import java.util.Scanner;
public class BJ2908 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String num1=sc.next();
String num2=sc.next(); //두숫자를 문자로 받기
String[] num1str=new String[3];
String[] num2str=new String[3];
for(int i=0;i<num1str.length;i++) {
num1str[i]=num1.substring(i, i+1);
num2str[i]=num2.substring(i, i+1);
}
String temp1=num1str[0];
num1str[0]=num1str[2];
num1str[2]=temp1;
String temp2=num2str[0];
num2str[0]=num2str[2];
num2str[2]=temp2;
int a=100*Integer.parseInt(num1str[0])+10*Integer.parseInt(num1str[1])+Integer.parseInt(num1str[2]);
int b=100*Integer.parseInt(num2str[0])+10*Integer.parseInt(num2str[1])+Integer.parseInt(num2str[2]);
if(a>=b){System.out.println(a);}
else System.out.println(b);
}
}