forked from edward210400/proj_1340
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetdays.cpp
More file actions
29 lines (26 loc) · 851 Bytes
/
getdays.cpp
File metadata and controls
29 lines (26 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @Date: 2019-04-27T22:14:44+08:00
* @Last modified time: 2019-04-27T23:08:27+08:00
*/
#include "test.h"
int getdays(string month) //Get the days in a month.
{
int days;
if ((month=="January")||(month=="March")||(month=="May")||(month=="July")||(month=="August")||(month=="October")||(month=="December")||(month=="january")||(month=="march")||(month=="may")||(month=="july")||(month=="august")||(month=="october")||(month=="december"))
{
days = 31;
}
else if ((month=="February")||(month=="february"))
{
days = 28;
}
else if ((month=="April")||(month=="april")||(month=="June")||(month=="june")||(month=="September")||(month=="september")||(month=="November")||(month=="november"))
{
days = 30;
}
else
{
days=0;
}
return days; //Return the number of days.
}