#include <stdio.h> int main() { int D,M,Y,d,m,y; int n=0; int Days, days; scanf("%d", &n); for(int i=1;i<=n;i++) { scanf("%d/%d/%d", &D, &M, &Y); scanf("%d/%d/%d", &d, &m, &y); Days=Y*12*31+(M-1)*31+D; days=y*12*31+(m-1)*31+d; if(Days<days) { printf("Case #%d: Invalid birth date\n", i); } else if ((Days-days)>=131*(12*31)) { printf("Case #%d: Check birth date\n", i); } else { printf("Case #%d: %d\n", i,(Days-days)/(12*31) ); } } return 0; }
|