fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3.  
  4. import java.util.*;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. Scanner sc = new Scanner (System.in);
  15. System.out.println("Please enter your Chinese grade.");
  16. double cg = sc. nextDouble();
  17. System.out.println("Please enter your Math grade.");
  18. double mg = sc. nextDouble();
  19. if (mg > 80 && cg > 80)
  20. {
  21. System.out.println("Gain 500 yuan!");
  22. }
  23. if (mg < 30 && cg < 30)
  24. {
  25. System.out.println("You have to retake the classes");
  26. }
  27. }
  28. }
Success #stdin #stdout 0.19s 55868KB
stdin
98
98
stdout
Please enter your Chinese grade.
Please enter your Math grade.
Gain 500 yuan!