基础题。
#include <iostream>
using namespace std;
int num[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int main()
{
int T;
cin >> T;
int month, day;
while (T--)
{
cin >> month >> day;
if (month > 10)
cout << "What a pity, it has passed!" << endl;
else if (month < 10)
{
int total = 0;
total += (num[month] - day + 1);
for (int i = month + 1; i < 10; i++)
total += num[i];
total += 20;
cout << total << endl;
}
else
{
if (day > 21)
cout << "What a pity, it has passed!" << endl;
else if (day < 21)
cout << 21 - day << endl;
else
cout << "It's today!!" << endl;
}
}
return 0;
}
继续加油。