Untitled

mail@pastecode.io avatar
unknown
c_cpp
8 months ago
391 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
    int mass[100];
    int i = 0;
    int n;
    cin >> n;
    while (n != -1)
    {
        mass[i] = n;
        i++;
        cin >> n;
    }
    int centralniyindex = i / 2, centralnoechislo = mass[centralniyindex];
    if (i == 0)
        cout << "empty";
    else
        cout << centralnoechislo;
    return 0;
}
Leave a Comment