Information
- ID
- 366
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- 5
- Tags
- # Submissions
- 24
- Accepted
- 14
- Uploaded By
#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;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.