Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- String month = input.nextLine();
- int day = Integer.parseInt(input.nextLine());
- if (month.equals("March") && day >= 20 ||
- month.equals("April") ||
- month.equals("May") ||
- month.equals("June") && day <= 20) {
- System.out.println("Spring");
- }else
- if(month.equals("June") && day >= 21 ||
- month.equals("July") ||
- month.equals("August") ||
- month.equals("September") && day <= 21){
- System.out.println("Summer");
- }else
- if(month.equals("September") && day >= 22 ||
- month.equals("October") ||
- month.equals("November") ||
- month.equals("December") && day <= 20){
- System.out.println("Autumn");
- }else{
- System.out.println("Winter");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement