Codeforces 478A - Initial Bet Solution
Solution in C++:
///******Bismillahir-Rahmanir-Rahim******///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include<bits/stdc++.h>
- using namespace std;
- main()
- {
- int s=0,a[10],i;
- for(i=0;i<5;i++)
- {
- cin>>a[i];
- s+=a[i];
- }
- if((s!=0)&&(s%5==0))
- cout<<s/5<<endl;
- else
- cout<<"-1"<<endl;
- }
No comments