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 Scanner = new Scanner(System.in);
- String month = Scanner.nextLine();
- int date = Scanner.nextInt();
- if (month == "January") {
- if (date >= 1 && date <= 31) {
- System.out.println("winter");
- }
- }
- if (month == "February") {
- if (date >= 1 && date <= 28) {
- System.out.println("winter");
- }
- }
- if (month == "March") {
- if (date >= 1 && date <= 20) {
- System.out.println("winter");
- }
- }
- if (month == "March") {
- if (date >= 21 && date <= 31) {
- System.out.println("spring");
- }
- }
- if (month == "April") {
- if (date >= 1 && date <= 30) {
- System.out.println("spring");
- }}
- if (month == "May") {
- if (date >= 1 && date <= 31) {
- System.out.println("spring");}}
- if(month == "June"){
- if(date>=1 && date <=21){
- System.out.println("spring");}
- }
- if(month == "July") {
- if(date >=22 && date <=31){
- System.out.println("summer");}
- }
- if (month=="August"){
- if (date >=1 && date <=31){
- System.out.println("summer");}
- }if(month == "September"){
- if(date >=1 && date <=22){
- System.out.println("summer");}
- }
- if (month=="september") {
- if (date >= 23 && date <= 30) {
- System.out.println("autumn");
- }}
- if (month == "October") {
- if (date >= 1 && date < +30) {
- System.out.println("autumn");}
- }if(month == "November"){
- if (date>=1 && date<=30){
- System.out.println("autumn");}
- }if(month == "December"){
- if(date >=1 && date<=21){
- System.out.println("autumn");}
- }if(month == "December"){
- if(date >= 22 && date<=31){
- System.out.println("winter");}
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement