Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- int main() {
- int n; scanf("%D", &n);
- int campo[n+2];
- campo[0] = 0;
- campo[n+1] = 0;
- for(int k = 1; k <= n; k++){
- scanf("%d", &campo[k]);
- }
- for(int k = 1; k <= n; k++){
- printf("%d\n", campo[k-1]+campo[k]+campo[k+1]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement