1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int new_a; int new_b; new_a = (a%10)*100+(a/10%10)*10+(a/100); new_b = (b%10)*100+(b/10%10)*10+(b/100); System.out.println((new_a>new_b)?new_a:new_b); } } |
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 | import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int a1,a2,a3; int c=0; int b = sc.nextInt(); int b1,b2,b3; int d=0; a1=a/100; a2=a/10%10; a3=a%10; b1=b/100; b2=b/10%10; b3=b%10; c=a3*100+a2*10+a1; d=b3*100+b2*10+b1; if(c>d) System.out.println(c); else System.out.println(d); } } | cs |
'Studying JAVA > 백준' 카테고리의 다른 글
[7단계]문자열 사용하기-2941번 크로아티아 알파벳 (0) | 2019.03.15 |
---|---|
[7단계]문자열 사용하기-5622번 다이얼 (0) | 2019.03.15 |
[7단계]문자열 사용하기-1152번 단어의 개수 (0) | 2019.03.15 |
[7단계]문자열 사용하기-1316번 그룹단어 체커 (0) | 2019.03.15 |
[7단계]문자열 사용하기-1157번 단어공부 (0) | 2019.03.15 |