fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main
  4. {
  5. public static void main (String[] args)
  6. {
  7. int monthNumber;
  8. String seasonName;
  9. Scanner scanner = new Scanner(System.in);
  10.  
  11. monthNumber = scanner.nextInt();
  12.  
  13. seasonName = ((monthNumber % 12) < 3) ? "Winter" : (monthNumber < 6) ? "Spring" :
  14. (monthNumber < 9) ? "Summer" : "Autumn";
  15.  
  16. System.out.println(seasonName);
  17. }
  18. }
Success #stdin #stdout 0.09s 2841600KB
stdin
12
stdout
Winter