Skip to content

Instantly share code, notes, and snippets.

@nk4dev
Created July 3, 2023 02:38
Show Gist options
  • Save nk4dev/67b122f317e54e20055e69dfeb0e56ba to your computer and use it in GitHub Desktop.
Save nk4dev/67b122f317e54e20055e69dfeb0e56ba to your computer and use it in GitHub Desktop.
//クラス名は必ずMainにする必要があります。
import java.util.*;
public class Main {
public static void main(String args[] ) throws Exception {
Scanner sc = new Scanner(System.in);
String s = sc.next();
String s2 = sc.next();
String s3 = sc.next();
int sleng = s.length();
int sleng2 = s2.length();
int sleng3 = s3.length();
String result = sleng > sleng2 &&sleng > sleng3 ? s : sleng2 > sleng3 ? s2 :s3;
System.out.print(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment