1 solutions
-
0
#include<iostream> #include <bits/stdc++.h> using namespace std; int main() { int a[10]; for(int i = 1 ;i <= 5 ;i++){ cin >> a[i]; } for(int i = 1; i<= 5 ;i++){ a[i] = a[i]/3; if(i == 1){ a[5] += a[i]; }else{ a[i-1] += a[i]; } if(i == 5){ a[1] += a[i]; }else{ a[i+1] += a[i]; } } for(int i = 1 ;i <= 5 ;i++){ cout << a[i] << " "; } return 0; }
Information
- ID
- 366
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- 5
- Tags
- # Submissions
- 24
- Accepted
- 14
- Uploaded By