Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
732 B
0
Indexable
Never
#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int a,b,c,d,e,f;
        cin>>a>>b>>c;
        cin>>d>>e>>f;
        int x=c-f;
//        cout<< "Case #"<<i<<": ";
        if(x<=0){
            cout<< "Case #"<<i<<": "<< "Invalid birth date"<< endl;
        }
        else if(x>130){
            cout<< "Case #"<<i<<": "<< "Check birth date"<< endl;
        }
        else if (x>0 && x<130){
                if(x<=1 && (a==d||  b==e)){
                    cout<< "Case #"<<i<<": "<<"0"<< endl;
                }
                else{
                    cout<< "Case #"<<i<<": "<< x<< endl;
                }
        }
    }
return 0;
}