思路:全部加起来,判断是否能整除5
#include<iostream>
using namespace std;
int main()
{
int c[6]={0};
int sum=0;
for(int i=1;i<=5;i++)
{
cin>>c[i];
sum+=c[i];
}
if(sum==0) cout<<-1;
else if(sum%5==0) cout<<sum/5;
else cout<<-1;
return 0;
}