| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 80244 | 胡盛哲 | 数组中元素交换 | C++ | Wrong Answer | 0 MS | 268 KB | 291 | 2024-07-11 11:49:04 |
#include<bits/stdc++.h> using namespace std; int a[101]; int main(){ int n; cin >> n; for(int i=1; i<n; i++){ cin>> a[i]; } int t; for(int i=1; i<n; i=i+2){ t = a[i]; a[i] = a[i+1]; a[i+1]=t; } for(int i =0 ;i<n; i++){ cout << a[i]<< ' '; } return 0; }
------Input------
1 49
------Answer-----
49
------Your output-----
0