fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n, count = 0;
  5. scanf("%d", &n);
  6.  
  7. for (int i = 0; i < n; i++) {
  8. int alphabet[26] = {0};
  9. char word[100];
  10. scanf("%s", word);
  11.  
  12. for (int j = 0; word[j] != '\0'; j++) {
  13. int index = word[j] - 'a';
  14. if (alphabet[index] == 0) {
  15. alphabet[index] = 1;
  16. } else {
  17. count++;
  18. break;
  19. }
  20. }
  21. }
  22.  
  23. printf("%d\n", count);
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 5284KB
stdin
3
happy
new
year
stdout
1