Advertisement
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.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.*;
- /* Номер месяца
- Программа вводит с клавиатуры имя месяца и выводит его номер на экран в виде: «May is 5 month».
- */
- public class Solution
- {
- public static void main(String[] args) throws IOException, ParseException
- {
- //add your code here - напиши код тут
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String myDate = reader.readLine();
- SimpleDateFormat sdf = new SimpleDateFormat("MMMM", Locale.ENGLISH);
- Date myDate1 = sdf.parse(myDate);
- System.out.println(myDate + " is " + ((myDate1.getMonth())+1)+" month");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement