Codeforces 478A - Initial Bet Solution

 Solution in C++: 

///******Bismillahir-Rahmanir-Rahim******///

///AH Tonmoy

///Department of CSE,23rd batch

///Islamic University,Bangladesh 

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. main()
  4. {
  5. int s=0,a[10],i;
  6. for(i=0;i<5;i++)
  7. {
  8. cin>>a[i];
  9. s+=a[i];
  10. }
  11. if((s!=0)&&(s%5==0))
  12. cout<<s/5<<endl;
  13. else
  14. cout<<"-1"<<endl;
  15. }

No comments

Most View Post

Recent post

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.