#include <stdio.h>
int validateIrishLicense(int year, int halfYear, char County, int Sequence1);
int main(void) {
int valid=validateIrishLicense(13,1,'D',21);
printf("The license is valid or not (1=valid, 0=no): %i\n", valid
); return 0;
}
int validateIrishLicense(int year, int halfYear, char County, int Sequence1){
int check=0;
if (year>=13 & year<=24){
check+=1;
}
if (halfYear==1 | halfYear==2){
check+=1;
}
char valid_county[]= {'C','c','D','d','G','g','L','l','T','t','W','w'};
const VAL_COUNTIES=12;
for (int i=0; i < VAL_COUNTIES; i++) {
check+=1;
printf("The license is valid or not (1=valid, 0=no): %i\n", check
); return check;
}
// }
// if (check==3){
// return 1;
// }
// else{
// return 0;
// }
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgdmFsaWRhdGVJcmlzaExpY2Vuc2UoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBDb3VudHksIGludCBTZXF1ZW5jZTEpOwoKaW50IG1haW4odm9pZCkgewoJaW50IHZhbGlkPXZhbGlkYXRlSXJpc2hMaWNlbnNlKDEzLDEsJ0QnLDIxKTsKICAgIHByaW50ZigiVGhlIGxpY2Vuc2UgaXMgdmFsaWQgb3Igbm90ICgxPXZhbGlkLCAwPW5vKTogJWlcbiIsIHZhbGlkKTsKCXJldHVybiAwOwp9CgppbnQgdmFsaWRhdGVJcmlzaExpY2Vuc2UoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBDb3VudHksIGludCBTZXF1ZW5jZTEpewoKICAgIGludCBjaGVjaz0wOwoKICAgIGlmICh5ZWFyPj0xMyAmIHllYXI8PTI0KXsKICAgICAgICBjaGVjays9MTsKICAgIH0KCiAgICBpZiAoaGFsZlllYXI9PTEgfCBoYWxmWWVhcj09Mil7CiAgICAgICAgIGNoZWNrKz0xOwogICAgfQoKICAgIGNoYXIgdmFsaWRfY291bnR5W109IHsnQycsJ2MnLCdEJywnZCcsJ0cnLCdnJywnTCcsJ2wnLCdUJywndCcsJ1cnLCd3J307CiAgICBjb25zdCBWQUxfQ09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