#include <stdio.h>
int main(void) {
int arrA[] = {1,2,3,4,2,3,5,6,1};
int length = sizeof(arrA)/sizeof(arrA[0]);
int arrB[length];
int arrC[length];
int k,p,s;
k=0;
p=0;
for (int i = 0; i < length; i++) {
// 記錄重複元素
for (int j = i + 1; j < length; j++) {
if (arrA[i] == arrA[j]) {
arrB[k]=arrA[i];
k=k+1;
}
}
// 記錄非重複元素
s=0;
for (int j = 0; j < length; j++) {
if (arrA[i] == arrA[j]) {
s=s+1;
}
if (j==(length-1)) {
if (s==1) {
arrC[p]=arrA[i];
p=p+1;
}
}
}
}
//
for(int i = 0; i < k; i++) {
}
//
for(int i = 0; i < p; i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgYXJyQVtdID0gezEsMiwzLDQsMiwzLDUsNiwxfTsgICAgIAogICAgaW50IGxlbmd0aCA9IHNpemVvZihhcnJBKS9zaXplb2YoYXJyQVswXSk7ICAgIAogICAgaW50IGFyckJbbGVuZ3RoXTsKICAgIGludCBhcnJDW2xlbmd0aF07CiAgICBpbnQgayxwLHM7ICAgIAogICAgaz0wOwogICAgcD0wOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgeyAgICAKICAgIAkvLyDoqJjpjITph43opIflhYPntKAKICAgICAgICBmb3IgKGludCBqID0gaSArIDE7IGogPCBsZW5ndGg7IGorKykgeyAgICAKICAgICAgICAgICAgaWYgKGFyckFbaV0gPT0gYXJyQVtqXSkgewogICAgICAgICAgICAgICAgYXJyQltrXT1hcnJBW2ldOwogICAgICAgICAgICAgICAgaz1rKzE7CiAgICAgICAgICAgIH0KICAgICAgICB9IAogICAgICAgIC8vIOiomOmMhOmdnumHjeikh+WFg+e0oAogICAgICAgIHM9MDsKICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IGxlbmd0aDsgaisrKSB7ICAgIAogICAgICAgICAgICBpZiAoYXJyQVtpXSA9PSBhcnJBW2pdKSB7CiAgICAgICAgICAgICAgIHM9cysxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChqPT0obGVuZ3RoLTEpKSB7CiAgICAgICAgICAgICAgICBpZiAocz09MSkgewogICAgICAgICAgICAgICAJICBhcnJDW3BdPWFyckFbaV07CiAgICAgICAgICAgICAgICAgIHA9cCsxOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSAKICAgIC8vCiAgICBwcmludGYoIumHjeikh+WFg+e0oCBcbiIpOyAgICAKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBrOyBpKyspIHsgCiAgICAgIHByaW50ZigiJWRcbiIsIGFyckJbaV0pOyAgCQogICAgfQogICAgLy8KICAgIHByaW50Zigi6Z2e6YeN6KSH5YWD57SgIFxuIik7IAogICAgZm9yKGludCBpID0gMDsgaSA8IHA7IGkrKykgeyAKICAgICAgcHJpbnRmKCIlZFxuIiwgYXJyQ1tpXSk7ICAJCiAgICB9CglyZXR1cm4gMDsKfQoKCg==