This commit is contained in:
2026-06-15 09:00:38 +08:00
parent fec66377d5
commit 4640c5e02b
191 changed files with 6046 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdbool.h>
#define SIZE 10
int main() {
int arr[SIZE] = {2, 5, 3, 5, 1, 2, 6, 7, 8, 9};
bool used[SIZE] = {false}; // 用于标记数字是否已被使用
for (int i = 0; i < SIZE; ++i) {
if (!used[arr[i]]) { // 检查当前值是否已被使用
printf("First occurrence of %d\n", arr[i]);
used[arr[i]] = true; // 标记该值为已使用
}
}
return 0;
}