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. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. int a=1, b=2, max=0;
  14. /*if(a>b)
  15. max = a;
  16. else if(a<=b)
  17. max = b;*/
  18. max = (a>b)? a: b;
  19. System.out.printf("a=%d b=%d max=%d", a, b, max);
  20. }
  21. }
Success #stdin #stdout 0.09s 55992KB
stdin
Standard input is empty
stdout
a=1 b=2 max=2