输入 10 个数,输出相邻两数相加的和:
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库#include <iostream>
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库using namespace std;
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库int main()
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库{
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库long a[10];
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库for (int i = 0; i < 10; i++)
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库cin >> a[i];
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库for (int i = 0; i < 9; i++)
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库cout << a[i] + a[i+1] << ' ';
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库return 0;
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库}
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库程序运行结果:
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库41 69 76 53 46 96 18 76 8 3
DpA100150满分答卷(100150.com)-青少年编程等级考试及竞赛题库110 145 129 99 142 114 94 84 38