+ 1

What is the problem with test cases 3 and 5?

You receive a date and need to know what day of the week it is. Task: Create a program that takes in a string containing a date, and outputs the day of the week. Input Format: A string containing a date in either "MM/DD/YYYY" format or "Month Day, Year" format. Output Format: A string containing the day of the week from the provided date. Sample Input: 11/19/2019 Sample Output: Tuesday https://code.sololearn.com/c6oKVWqaOb8N/?ref=app

22nd May 2023, 10:09 AM
Monika Izydorczyk
Monika Izydorczyk - avatar
3 Réponses
+ 1
Nice 👍 Now that you've done it the hard way, also look up the std::chrono header, notably the "weekday" function.
23rd May 2023, 4:59 PM
Orin Cook
Orin Cook - avatar
0
The most boring but also hardest to f troubleshoot reason: it's just giving wrong answers. 5/12/1900 returns Thursday, for example, but should be Saturday.
22nd May 2023, 2:10 PM
Orin Cook
Orin Cook - avatar
0
Thanks, I decided to solve this problem in another way. It works now. https://code.sololearn.com/cyqXQh63nJ6v/?ref=app
23rd May 2023, 3:35 PM
Monika Izydorczyk
Monika Izydorczyk - avatar