fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.Scanner;
  5. public class Main{
  6. public static void main(String[] arg)
  7. {
  8. Scanner sc = new Scanner(System.in);
  9. int total = sc.nextInt();
  10. String[] inputs=new String[total];
  11. for(int i = 0;i<total;i++){
  12. inputs[i]=sc.next();
  13. }
  14. System.out.println(getStable(inputs));
  15. sc.close();
  16. }
  17. public static String getStable(String[] ary){
  18. string[] temp;
  19. int[][] nums=new int[ary.length][3];
  20. for(int i=0;i<ary.length;i++){
  21. temp = ary[i].split("\\.");
  22. for(int j=0;j<temp.length;j++){
  23. nums[i][j]=Integer.valueof(temp[j]);
  24. }
  25. }
  26. int maxMajor=0;int location=0;
  27. for(int i=0;i<ary.length;i++){
  28. if(nums[i][0]>maxMajor && nums[i][1]%2==0){
  29. maxMajor=nums[i][0];
  30. location=i;
  31. }
  32. }
  33. if(maxMajor==0){
  34. return "no stable available";
  35. }
  36. return ary[location];
  37. }
  38. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:18: error: cannot find symbol
			string[] temp;
			^
  symbol:   class string
  location: class Main
1 error
stdout
Standard output is empty