Question to the test ''New driver's license''
Hello Everybody! Can somebody look at my code to the test ''New driver's license'' and say what is wrong with it, it passed 4 test cases except 1 and I don't know where I made a bug. Will be happy for any help. ;) --------------------------------------------------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char name[20]; char other[80]; int agents, place = 1; scanf("%s %d\n", name, &agents); fgets(other, 80, stdin); if(name[0] > other[0]) place++; for(int i = 0; i < strlen(other); i++) { if(other[i] == ' ') { if(name[0] > other[i + 1]) place++; } } printf("%d", 20 + place * 20 - agents * 20); return 0; }