fork(18) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7.  
  8. class Solution {
  9. public static int min(int a, int b) {
  10. int m;
  11. if (a<b) {
  12. m = a;
  13. } else {
  14. m = b;
  15. }
  16. return m;
  17. }
  18. }
  19.  
  20. /* Name of the class has to be "Main" only if the class is public. */
  21. class Ideone
  22. {
  23. public static void main (String[] args) throws java.lang.Exception
  24. {
  25. Solution sol = new Solution();
  26.  
  27. System.out.println( sol.min(12,33) );
  28. System.out.println( sol.min(-20,0) );
  29. System.out.println( sol.min(-10,-20) );
  30. }
  31. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
12
-20
-20