Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
105593 王煜鑫 数组中元素交换 C++ Wrong Answer 1 MS 268 KB 261 2025-01-14 10:22:48

Tests(1/10):


Code:

#include<iostream> using namespace std; int a[102]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } int t; for(int j=1;j<n;j++){ t=a[j]; a[j]=a[j+1]; a[j+1]=t; } for(int k=1;k<=n;k++){ cout<<a[k]<<" "; } }


Run Info:

------Input------
5 81 43 69 80 80
------Answer-----
43 81 80 69 80
------Your output-----
43 69 80 80 81