Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
583 B
1
Indexable
Never
//домашка
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int n, a, s;
    cin >> n;
    s = 0;
    int y = n;
    while (y > 0)
    {
        y--;
        cin >> a;
        s += a;
    }
    double v = (double)s / n;
    if ((v)-((int)v) >= 0.5)
        cout << (int)v + 1;
    else
        cout << (int)v;
    if ((int)v <= 2)
        cout << "Dvoechnik";
    if ((int)v == 3)
        cout << "Troechnik";
    if ((int)v == 4)
        cout << "Horoshist";
    if ((int)v == 5)
        cout << "otlicnik";
    return 0;
Leave a Comment