Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<map>
- #include<string>
- using namespace std;
- int main()
- {
- string s;
- map <string,int> month =
- {
- {"January",31},
- {"February",28},
- {"March",31},
- {"April",30},
- {"May",31},
- {"June",30},
- {"July",31},
- {"August",31},
- {"September",30},
- {"October",31},
- {"November",30},
- {"December",31}
- };
- while(1)
- {
- cin>>s;
- if(s=="exit")break;
- if(month[s]) cout<<month[s]<<endl;
- else cout<<"unknown month"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement