import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
StringBuffer sb = new StringBuffer(str);
str = sb.reverse().toString();
String str2 = sc.next();
StringBuffer sb2 = new StringBuffer(str2);
str2 = sb2.reverse().toString();
int n1 = Integer.parseInt(str);
int n2 = Integer.parseInt(str2);
if(n1 > n2){
System.out.print(n1);
}
else{
System.out.print(n2);
}
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int count = 0;
for(int i=0; i<str.length(); i++){
switch(str.charAt(i)) {
case 'A' : case 'B': case 'C' :
count += 3;
break;
case 'D' : case 'E': case 'F' :
count += 4;
break;
case 'G' : case 'H': case 'I' :
count += 5;
break;
case 'J' : case 'K': case 'L' :
count += 6;
break;
case 'M' : case 'N': case 'O' :
count += 7;
break;
case 'P' : case 'Q': case 'R' : case 'S' :
count += 8;
break;
case 'T' : case 'U': case 'V' :
count += 9;
break;
case 'W' : case 'X': case 'Y' : case 'Z' :
count += 10;
break;
}
}
System.out.print(count);
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int[] ab = new int[26];
for(int i = 0; i<ab.length; i++){
ab[i] = -1;
}
for(int i = 0; i<str.length(); i++){
char c = str.charAt(i);
if(ab[c -'a'] == -1){
ab[c - 'a' ] = i;
}
}
for(int result : ab){
System.out.print(result+" ");
}
}
}
'JAVA' 카테고리의 다른 글
ep 07.문제 풀이 (0) | 2022.12.19 |
---|---|
ep 07. 기본 클래스 (0) | 2022.12.19 |
ep 06-1. Interface (0) | 2022.12.11 |
ep 05-2. 문제 풀이 (0) | 2022.12.02 |
ep 05-1.추상 클래스 (0) | 2022.12.02 |