Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char str1[50],str2[50];
- long long int t,a,b,x,y,i,c,fr,hd,frhd;
- scanf("%lld",&t);
- for(i=1;i<=t;i++){
- c=0;
- scanf("%s %lld, %lld",str1,&a,&x);
- scanf("%s %lld, %lld",str2,&b,&y);
- if(strcmp(str1,"January")!=0 && strcmp(str1,"February")!=0)
- x++;
- if((strcmp(str2,"January")==0 || (strcmp(str2,"February")==0) && b<29))
- y--;
- fr = y/4-(x-1)/4;
- hd = y/100-(x-1)/100;
- frhd = y/400-(x-1)/400;
- c = fr - hd + frhd;
- printf("Case %lld: %lld\n",i,c);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement