fork download
  1. #include <stdio.h>
  2.  
  3. int irishLicensePlateValidator(int year, int halfYear, char county);
  4.  
  5. int main(void) {
  6. printf("%i", irishLicensePlateValidator (24, 2, 'K'));
  7.  
  8. return 0;
  9. }
  10.  
  11. int irishLicensePlateValidator(int year, int halfYear, char county)
  12. {
  13. char validcounties[] = {'c', 'C', 'd', 'D', 'g', 'G', 'l', 'L', 't', 'T', 'w', 'W'};
  14. int i = 0;
  15. if (year < 13)
  16. {
  17. return 0;
  18. }
  19. if (year > 24)
  20. {
  21. return 0;
  22. }
  23. if (halfYear != 1)
  24. {
  25. if (halfYear != 2)
  26. {
  27. return 0;
  28. }
  29. }
  30. //while (i < 12)
  31. //{
  32. //if (validcounties[i] != county)
  33. //{
  34. //i++;
  35. //}
  36. //if (i == 12)
  37. //{
  38. // return 0;
  39. //}
  40. //}
  41. return 1;
  42.  
  43. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
1