fork(1) 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. public class Main
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. float f1 = 0.37885f;
  13. short s1 = (short)Math.round(f1);
  14. System.out.println("s1 = " + s1);
  15.  
  16. float f2 = 27.67885f;
  17. short s2 = (short)Math.round(f2);
  18. System.out.println("s2 = " + s2);
  19. }
  20. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
s1 = 0
s2 = 28