#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;
}
printf("The license is valid or not (1=valid, 0=no): %i\n", check
); return check;
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++) {
if (County==valid_county[i]){
check=+1;
}
}
// if (check==3){
// return 1;
// }
// else{
// return 0;
// }
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgdmFsaWRhdGVJcmlzaExpY2Vuc2UoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBDb3VudHksIGludCBTZXF1ZW5jZTEpOwoKaW50IG1haW4odm9pZCkgewoJaW50IHZhbGlkPXZhbGlkYXRlSXJpc2hMaWNlbnNlKDEzLDEsJ0QnLDIxKTsKICAgIHByaW50ZigiVGhlIGxpY2Vuc2UgaXMgdmFsaWQgb3Igbm90ICgxPXZhbGlkLCAwPW5vKTogJWlcbiIsIHZhbGlkKTsKCXJldHVybiAwOwp9CgppbnQgdmFsaWRhdGVJcmlzaExpY2Vuc2UoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBDb3VudHksIGludCBTZXF1ZW5jZTEpewoKICAgIGludCBjaGVjaz0wOwoKICAgIGlmICh5ZWFyPj0xMyAmIHllYXI8PTI0KXsKICAgICAgICBjaGVjaz0rMTsKICAgIH0KCiAgICBpZiAoaGFsZlllYXI9PTEgfCBoYWxmWWVhcj09Mil7CiAgICAgICAgIGNoZWNrKz0xOwogICAgfQoKICAgIHByaW50ZigiVGhlIGxpY2Vuc2UgaXMgdmFsaWQgb3Igbm90ICgxPXZhbGlkLCAwPW5vKTogJWlcbiIsIGNoZWNrKTsKICAgIHJld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