ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2056. Scholarship

WA#8
Posted by Piyush 5 Oct 2022 11:35
#include <bits/stdc++.h>
using namespace std;

signed main(){
  int n;
  cin>>n;
  int sum=0;
  for(int i=0;i<n;i++){
    int x;
    cin>>x;
    sum+=x;
  }
  double cnt1=(double)sum/(double)n;
  if(cnt1==3){
    cout<<"None";
  }else if(cnt1==5){
    cout<<"Named";
  }else if(cnt1>=4.5 && cnt1!=5){
    cout<<"High";
  }else if(cnt1!=3 && cnt1!=5 && cnt1<4.5){
    cout<<"Common";
  }
}
getting a wrong answer on test 8