Problem G
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 9 Accepted Submission(s) : 3
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
Input
Output
Sample Input
7 10 20 10 19 10 1 10 21 9 1 11 11 12 12
Sample Output
1 2 20 It's today!! 50 What a pity, it has passed! What a pity, it has passed!
水题 统计天数
代码
#include<iostream>
using namespace std;
int main()
{
int t;
int n,m;
int j,k,l;
int a[10]={0,31,28,31,30,31,30,31,31,30};
int sum;
cin>>t;
while(t--&&cin>>n>>m)
{
if(n!=10) sum=a[n]-m+21;
else sum=21-m;
if(n>10)
{cout<<"What a pity, it has passed!"<<endl;
continue;}
if(n==10&&m>21)
{
cout<<"What a pity, it has passed!"<<endl;
continue;
}
if(n==10&&m==21)
{
cout<<"It's today!!"<<endl;
continue;
}
for(j=n+1;j<10;j++)
{
sum+=a[j];
}
cout<<sum<<endl;
}
}