-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilip.java
More file actions
35 lines (29 loc) · 1022 Bytes
/
Copy pathfilip.java
File metadata and controls
35 lines (29 loc) · 1022 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
import java.lang.Math;
import java.lang.Integer;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Scanner;
public class filip {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
DecimalFormat precision6 = new DecimalFormat("0.000000");
String a = Integer.toString(input.nextInt());
String b = Integer.toString(input.nextInt());
String resA = "";
for (int i = a.length() - 1; i >= 0; i--) {
resA = resA + a.substring(i, i + 1);
}
String resB = "";
for (int i = b.length() - 1; i >= 0; i--) {
resB = resB + b.substring(i, i + 1);
}
if (Integer.parseInt(resA) > Integer.parseInt(resB)) {
System.out.print(resA);
} else {
System.out.print(resB);
}
}
static int pow(double n, double p) {
return (int)Math.pow(n, p);
}
}