Advertisement
Deinio

Untitled

May 19th, 2022
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class main {
  4. public static void main(String[] args) {
  5. Scanner Scanner = new Scanner(System.in);
  6. String month = Scanner.nextLine();
  7. int date = Scanner.nextInt();
  8. if (month == "January") {
  9. if (date >= 1 && date <= 31) {
  10. System.out.println("winter");
  11. }
  12. }
  13. if (month == "February") {
  14. if (date >= 1 && date <= 28) {
  15. System.out.println("winter");
  16. }
  17. }
  18. if (month == "March") {
  19. if (date >= 1 && date <= 20) {
  20. System.out.println("winter");
  21. }
  22. }
  23. if (month == "March") {
  24. if (date >= 21 && date <= 31) {
  25. System.out.println("spring");
  26. }
  27. }
  28. if (month == "April") {
  29. if (date >= 1 && date <= 30) {
  30. System.out.println("spring");
  31. }}
  32. if (month == "May") {
  33. if (date >= 1 && date <= 31) {
  34. System.out.println("spring");}}
  35. if(month == "June"){
  36. if(date>=1 && date <=21){
  37. System.out.println("spring");}
  38. }
  39. if(month == "July") {
  40. if(date >=22 && date <=31){
  41. System.out.println("summer");}
  42. }
  43. if (month=="August"){
  44. if (date >=1 && date <=31){
  45. System.out.println("summer");}
  46. }if(month == "September"){
  47. if(date >=1 && date <=22){
  48. System.out.println("summer");}
  49. }
  50. if (month=="september") {
  51. if (date >= 23 && date <= 30) {
  52. System.out.println("autumn");
  53. }}
  54. if (month == "October") {
  55. if (date >= 1 && date < +30) {
  56. System.out.println("autumn");}
  57. }if(month == "November"){
  58. if (date>=1 && date<=30){
  59. System.out.println("autumn");}
  60. }if(month == "December"){
  61. if(date >=1 && date<=21){
  62. System.out.println("autumn");}
  63. }if(month == "December"){
  64. if(date >= 22 && date<=31){
  65. System.out.println("winter");}
  66. }
  67.  
  68. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement