| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 231 | 116 | 73 | 49.324% |
You are starting to get annoyed with how your phone shows you the date, so you want to put it into a different format. Currently, your phone gives you the date in the format Month Day, Year (ex. July 25, 2018). Your goal is to shorten the format exactly like this, MM/DD/YY, where M is month, D is day, and Y is year (ex. 07/25/18). Write a program that will calculate this format change.
The first line will contain a single integer n that indicates the number of lines that follow. The next n lines will be in the format Month Day, Year. The full year integer will be between 1 and 300,000,000.
Your output should be the same date as the input, but in the new format MM/DD/YY. If the month, day or year is only one digit, pad with a 0. If the date is not valid (the month is spelled incorrectly, the day is less than 1 or greater than 31), print Invalid. You do not need to check that the day fits within the month's days, just that it is not greater than 31. The year format will be the last two digits (or 1 digit padded with a 0) of the input year.
3 February 5, 990 December 25, 12018 Decembuary 31, 2000
02/05/90 12/25/18 Invalid
School > PLU High School Programming Contest > PLU 2020 > Novice 4번