| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 77818 | 苏馨怡 | 18成绩插入 | C++ | Wrong Answer | 0 MS | 272 KB | 343 | 2024-06-15 15:09:26 |
#include<iostream> #include<iomanip> using namespace std; int main() { int n; cin >> n; int a[101]; for (int i = 1; i <= n; i++) { cin >> a[i]; } int pos; cin >> pos; int m = a[n]; for (int i = 5; i >= 1; i--) { a[i + 1] = a[i]; } a[pos] = m; for (int i = 1; i <= n + 1; i++) { cout << a[i] << " "; } }
------Input------
68 87 45 25 60 54 59 89 86 21 27 60 21 67 62 89 89 43 61 79 38 67 57 19 9 81 94 36 72 20 42 54 35 16 15 99 22 1 39 21 88 87 9 79 56 22 79 69 12 1 57 33 83 13 12 21 11 14 75 66 53 8 61 19 24 14 74 20 7 17
------Answer-----
17 87 45 25 60 54 59 89 86 21 27 60 21 67 62 89 89 43 61 79 38 67 57 19 9 81 94 36 72 20 42 54 35 16 15 99 22 1 39 21 88 87 9 79 56 22 79 69 12 1 57 33 83 13 12 21 11 14 75 66 53 8 61 19 24 14 74 20 7
------Your output-----
87 87 45 25 60 54 89 86 21 27 60 21 67 62 89 89 7 61 79 38 67 57 19 9 81 94 36 72 20 42 54 35 16 15 99 22 1 39 21 88 87 9 79 56 22 79 69 12 1 57 33 83 13 12 21 11 14 75 66 53 8 61 19 24 14 74 20 7 0