Loading... ```cpp #include<bits/stdc++.h> using namespace std; const int N = 100; int n; int arr[N]; int main(){ cin >> n; for(int i = 0; i < n; i++) cin >> arr[i]; int j = 0; // 非重复个数 for(int i = 0; i < n; i++) if(!i || arr[i] != arr[i - 1]) arr[j++] = arr[i]; return 0; } ``` Last modification:January 20, 2023 © Allow specification reprint Like 0 如果觉得我的文章对你有用,请随意赞赏
Comment here is closed