ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#156380 | #978. 逆序输出 | yangzibin | 100 | 0ms | 1200kb | C++ | 288b | 2022-08-07 15:18:43 | 2022-08-07 15:18:44 |
answer
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int n,s;
int main()
{
cin>>n;
int a[n];
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++)cout<<a[i]<<" ";
cout<<endl;
for(int i=1,s=n;i<=n;i++)
{
cout<<a[s]<<" ";
s--;
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 20
Accepted
time: 0ms
memory: 1200kb
input:
5 32 54 12 44 8
output:
32 54 12 44 8 8 44 12 54 32
result:
ok 2 lines
Test #2:
score: 20
Accepted
time: 0ms
memory: 1196kb
input:
296 91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 7...
output:
91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 78 80...
result:
ok 2 lines
Test #3:
score: 20
Accepted
time: 0ms
memory: 1196kb
input:
182 91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 7...
output:
91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 78 80...
result:
ok 2 lines
Test #4:
score: 20
Accepted
time: 0ms
memory: 1196kb
input:
908 91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 7...
output:
91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 78 80...
result:
ok 2 lines
Test #5:
score: 20
Accepted
time: 0ms
memory: 1200kb
input:
911 91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 7...
output:
91 7 5 1 89 57 44 36 44 35 15 41 7 41 41 44 74 39 70 14 19 70 6 45 36 4 73 67 24 4 10 73 81 26 78 80...
result:
ok 2 lines