#include <stdio.h>
int irishLicensePlateValidator(int year, int halfYear, char county);
int main(void) {
printf("%i", irishLicensePlateValidator
(24, 2, 'K'));
return 0;
}
int irishLicensePlateValidator(int year, int halfYear, char county)
{
char validcounties[] = {'c', 'C', 'd', 'D', 'g', 'G', 'l', 'L', 't', 'T', 'w', 'W'};
int i = 0;
if (year < 13)
{
return 0;
}
if (year > 24)
{
return 0;
}
if (halfYear != 1)
{
if (halfYear != 2)
{
return 0;
}
}
//while (i < 12)
//{
//if (validcounties[i] != county)
//{
//i++;
//}
//if (i == 12)
//{
// return 0;
//}
//}
return 1;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgaXJpc2hMaWNlbnNlUGxhdGVWYWxpZGF0b3IoaW50IHllYXIsIGludCBoYWxmWWVhciwgY2hhciBjb3VudHkpOwoKaW50IG1haW4odm9pZCkgewoJcHJpbnRmKCIlaSIsIGlyaXNoTGljZW5zZVBsYXRlVmFsaWRhdG9yICgyNCwgMiwgJ0snKSk7CgoJcmV0dXJuIDA7Cn0KCmludCBpcmlzaExpY2Vuc2VQbGF0ZVZhbGlkYXRvcihpbnQgeWVhciwgaW50IGhhbGZZZWFyLCBjaGFyIGNvdW50eSkKewoJY2hhciB2YWxpZGNvdW50aWVzW10gPSB7J2MnLCAnQycsICdkJywgJ0QnLCAnZycsICdHJywgJ2wnLCAnTCcsICd0JywgJ1QnLCAndycsICdXJ307CglpbnQgaSA9IDA7CglpZiAoeWVhciA8IDEzKQoJewoJICAgIHJldHVybiAwOwoJfQoJaWYgKHllYXIgPiAyNCkKCXsKCSAgICByZXR1cm4gMDsKCX0KCWlmIChoYWxmWWVhciAhPSAxKQoJewoJICAgIGlmIChoYWxmWWVhciAhPSAyKQoJICAgIHsKCQlyZXR1cm4gMDsKCSAgICB9Cgl9CgkvL3doaWxlIChpIDwgMTIpCgkvL3sKCSAgICAvL2lmICh2YWxpZGNvdW50aWVzW2ldICE9IGNvdW50eSkKCSAgICAvL3sKCSAgICAgICAgLy9pKys7CgkgICAgLy99CgkgICAgLy9pZiAoaSA9PSAxMikKCSAgICAvL3sKCSAgICAgICAvLyByZXR1cm4gMDsKCSAgICAvL30KCS8vfQoJcmV0dXJuIDE7Cgp9