| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 153666 | 鲁博睿 | 指针遍历数组II | C++ | Accepted | 1 MS | 264 KB | 313 | 2026-05-23 17:20:15 |
#include <bits/stdc++.h> ? using namespace std; int a[10005]; int main() { int b,n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } int *p=&a[1]; for(int j=0;j<n;j++){ if(*(p+j)%2==0){ *(p+j)-=1; } else if(*(p+j)%2!=0){ *(p+j)+=1; } cout<<*(p+j)<<" "; } return 0; }