We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 744dc9a commit fefbaf5Copy full SHA for fefbaf5
Easy/LargestPair.java
@@ -0,0 +1,28 @@
1
+import java.util.*;
2
+import java.io.*;
3
+
4
+class Main {
5
6
+ public static int LargestPair(int num) {
7
+ // code goes here
8
+ int maxPair = 0;
9
+ int pair = 0;
10
11
+ while (num != 0){
12
+ pair = num % 100;
13
14
+ if(pair > maxPair){
15
+ maxPair = pair;
16
+ }
17
+ num /= 10;
18
19
+ return maxPair;
20
21
22
+ public static void main (String[] args) {
23
+ // keep this function call here
24
+ Scanner s = new Scanner(System.in);
25
+ System.out.print(LargestPair(s.nextLine()));
26
27
28
+}
0 commit comments