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

Unable to find why compilation error
Posted by Tasin 22 Jun 2022 12:16
#include<stdio.h>
int main()
{
    int n,i,sum = 0;
    float res;
    scanf("%d",& n);

    int arr[n];

    for(i = 1; i <= n; i++)
    {
        scanf("%d",&arr[i]);
        sum += arr[i];
    }
    for(i = 1 ; i <= n; i++)
    {
        if(arr[i] == 3)
        {
            printf("None\n");
            break;
        }
    }

    res = (float)sum / n;

    if(res == 5)
    printf("Named\n");
    else if(res >= 4.5)
    printf("High\n");
    else if ((res < 4.5 && res >= 4))
    printf("Common\n");


    return 0;
}