반응형
Java
풀이 1번 / 2번
/*
* Author : Jeonghun Cho
* Date : December 5, 2019
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] inputNumber = br.readLine().split(" ");
for(int i=0; i<inputNumber.length; i++) {
String temp = inputNumber[i].charAt(0)+"";
String temp2 = inputNumber[i].charAt(2)+"";
inputNumber[i] = temp2+(inputNumber[i].charAt(1)+"")+temp;
}
if(Integer.parseInt(inputNumber[0]) > Integer.parseInt(inputNumber[1])) {
System.out.println(inputNumber[0]);
}else {
System.out.println(inputNumber[1]);
}
}
}
Colored by Color Scripter
|
/*
* Author : Jeonghun Cho
* Date : December 5, 2019
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer();
StringTokenizer st = new StringTokenizer(br.readLine());
String a = st.nextToken();
String b = st.nextToken();
if(first > second) {
System.out.println(first);
}else {
System.out.println(second);
}
}
}
Colored by Color Scripter
|
C언어
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
a=(a%10)*100+((a/10)%10)*10+a/100;
b=(b%10)*100+((b/10)%10)*10+b/100;
if(a>b)
printf("%d",a);
else
printf("%d",b);
return 0;
}
|
반응형
'알고리즘 > 백준' 카테고리의 다른 글
[백준] 2675 문자열 반복 (Java) (0) | 2019.12.06 |
---|---|
[백준] 1152 단어의 개수 (Java) (0) | 2019.12.06 |
[백준] 5622 다이얼 (Java) (0) | 2019.12.05 |
[백준] 11654 아스키 코드 (Java) (0) | 2019.12.04 |
[백준] 15596 정수 N개의 합 (Java) (0) | 2019.12.04 |