0
已解决
程之行
高级守护
高级守护
#include<bits/stdc++.h>
using namespace std;
int month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int k, x, y, count2=0, count1=0,a, b, c, d;
int work(int n, int m){
int a, b, c, d, sum=0, cnt=0;
a = n/100; b=n-a*100;
c = m/100; d=m-c*100;
for (int i=1; i<a; i++){
sum += month[i];
}
count1=sum+b;
for (int j=1; j<c; j++){
cnt += month[j];
}
count2=cnt+d;
return abs(sum-cnt);
}
int main(){
cin >> k;
for (int i=1; i<=k; i++){
cin >> x >> y;
if(work(x,y)>100) cout << "YES" << endl;
else cout << "NO" << endl;
}
}
为什么错了