Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int m, g;
- cin >> m >> g;
- if(m == 2) {
- if(g % 400 == 0) {
- cout << 29 << endl;
- }
- else if(g % 4 == 0 and g % 100 != 0) {
- cout << 29 << endl;
- }
- else {
- cout << 28 << endl;
- }
- }
- else if(m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m == 10 or m == 12) {
- cout << 31 << endl;
- }
- else {
- cout << 30 << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement