#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++) {
if (County==valid_county[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+CgppbnQgdmFsaWRhdGVJcmlzaExpY2Vuc2UoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBDb3VudHksIGludCBTZXF1ZW5jZTEpOwoKaW50IG1haW4odm9pZCkgewoJaW50IHZhbGlkPXZhbGlkYXRlSXJpc2hMaWNlbnNlKDEzLDEsJ0QnLDIxKTsKICAgIHByaW50ZigiVGhlIGxpY2Vuc2UgaXMgdmFsaWQgb3Igbm90ICgxPXZhbGlkLCAwPW5vKTogJWlcbiIsIHZhbGlkKTsKCXJldHVybiAwOwp9CgppbnQgdmFsaWRhdGVJcmlzaExpY2Vuc2UoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBDb3VudHksIGludCBTZXF1ZW5jZTEpewoKICAgIGludCBjaGVjaz0wOwoKICAgIGlmICh5ZWFyPj0xMyAmIHllYXI8PTI0KXsKICAgICAgICBjaGVjaz0rMTsKICAgIH0KCiAgICBpZiAoaGFsZlllYXI9PTEgfCBoYWxmWWVhcj09Mil7CiAgICAgICAgIGNoZWNrKz0xOwogICAgfQoKICAgIGNoYXIgdmFsaWRfY291bnR5W109IHsnQycsJ2MnLCdEJywnZCcsJ0cnLCdnJywnTCcsJ2wnLCdUJywndCcsJ1cnLCd3J307CiAgICB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