fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10.  
  11. public static void main(String[] args){
  12. Scanner s=new Scanner(System.in);
  13. int a=s.nextInt();
  14. String output="",input="";
  15. String[] b=new String[a];
  16. for(int i=0;i<a;i++)
  17. {
  18. b[i]=s.next();
  19. input=input+b[i];
  20. }
  21. output=otp(input,a,b);
  22. System.out.println(output);
  23. }
  24. public static String otp(String input,int a,String b[]){
  25.  
  26. int o=0;
  27. String output="";
  28. String[] on=new String[100];
  29. for(int i=0;i<a;i++)
  30. {
  31. char[] q=b[i].toCharArray();
  32. for(int j=0;j<q.length-1;j++)
  33. {
  34. on[o]="";
  35. on[o]=q[j]+""+q[j+1];
  36. ++o;
  37. }
  38. }
  39. Arrays.sort(on,0,o);
  40. output=output+on[o-1];
  41. char[] in=input.toCharArray();
  42. Arrays.sort(in);
  43. int m=0;
  44. m=in[2]+in[in.length-1];
  45. m=m-48-48;
  46. output=output+m;
  47. return output;
  48. }
  49. }
  50.  
Runtime error #stdin #stdout #stderr 0.06s 4386816KB
stdin
85 658 801 459
stdout

Standard output is empty

stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1371)
	at Ideone.main(Main.java:18)