View Code of Problem 8

#include<iostream>
#include<string>

using namespace std;
int date[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
int main() {
	int t;
	cin >> t;
	while (t--) {
		int days = 0;
		string str;
		cin >> str;
		int endNum=str[7]-'0';
		if (endNum >= 3 && endNum <= 7)
			cout << 293 << endl;
		else if (endNum == 0)
			cout << 287 << endl;
		else if (endNum == 1 || endNum == 8 || endNum == 9)
			cout << 294 << endl;
		else if (endNum == 2)
			cout << 286 << endl;
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 8