#include <iostream>
#define SIZE 256
void CountOccurrences(std::string str, char occurrences[]) {
int i = 0;
int size = str.length();
while (i < size) {
occurrences[(int)str[i]]++;
i++;
}
}
char PrintAllNonRepeatingCharacters(std::string str) {
char occurrences[SIZE] = { 0 };
CountOccurrences(str, occurrences);
int i = 0;
int size = str.length();
while (i < size) {
if (occurrences[(int)str[i]] == 1) {
std::cout << str[i] << "\n";
}
i++;
}
return -1;
}
int main() {
std::string str = "c c++ csharp java php python";
PrintAllNonRepeatingCharacters(str);
}
/*
run:
s
r
j
v
y
t
o
n
*/