Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- using namespace std;
- int N = 6, i, k;
- int a[N];
- for(i = 0; i < N; i++)
- cin >> a[i];
- //начало своей части
- int j[N];
- for (i = 0; i < N; i++)
- j[i] = a[i];
- k = (a[0] + a[1]) / 2;
- cout << k << " ";
- for (i = 1; i < N - 1; i++)
- j[i] = (a[i - 1] + a[i] + a[i + 1]) / 3;
- for(i = 1; i < N - 1; i++)
- cout << j[i] << " ";
- a[N - 1] = (a[N - 2] + a[N - 1]) / 2;
- cout << a[N - 1];
- return 0;
- }
- //0 1 2 3 4 5
- //1 9 2 10 3 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement