补全9月11日至13日课评:为13名学生创建请假文档,为5个班级创建总结文档

This commit is contained in:
chengzi
2026-09-13 19:34:34 +08:00
parent 167d832353
commit 21001eccf5
1322 changed files with 37510 additions and 4136 deletions

View File

@@ -0,0 +1,36 @@
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int MAXN = 100010;
int n;
int arr[MAXN];
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> arr[i];
}
if(n == 0){
cout << endl << 0 << endl;
return 0;
}
int j = 1; // 慢指针
for(int i = 2; i <= n; i++){
// i表示快指针,一直向后移动
if(arr[i] == arr[j]) continue;
// 如果不相同
arr[j+1] = arr[i];
j++;
}
for(int i = 1; i <= j; i++){
cout << arr[i] << " ";
}
cout << endl << j;
return 0;
}