Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - package com.javarush.test.level08.lesson11.bonus01;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.util.Date;
- /* Номер месяца
- Программа вводит с клавиатуры имя месяца и выводит его номер на экран в виде: «May is 5 month».
- */
- public class Solution
- {
- public static void main(String[] args) throws IOException
- {
- //add your code here - напиши код тут
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String month = reader.readLine();
- String allDate = (month+" "+"01"+" 1970");
- Date fullDate = new Date(allDate);
- int monthNumber=(fullDate.getMonth()+1);
- System.out.println(month+" "+"is"+" "+monthNumber+" "+"month");
- }
- }
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment                    
                 
                    