#include <stdio.h>
#define SIZE 256
void count_occurrences(char s[], char occurrences[]) {
int i = 0;
while (s[i]) {
occurrences[(int)s[i]]++;
i++;
}
}
int main() {
char s[] = "java c c++ csharp php python";
char occurrences[SIZE] = { 0 };
count_occurrences(s, occurrences);
int i = 0;
while (s[i]) {
if (occurrences[(int)s[i]] > 1) {
printf("%c\n", s[i]);
occurrences[(int)s[i]] = -1;
}
i++;
}
return 0;
}
/*
run:
a
c
+
h
p
*/