Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
391 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	setlocale(LC_ALL, "Russian");
	int i = 0, a = 0;
	int mas[100];
	int mar = 0;
	for (int i = 0; i < 100; i++) {
		cin >> mas[i];
		a++;
		if (mas[i] == -1) {
			break;
		}
		mar++;
	}
	if (a % 2 != 0) {
		cout << mas[a / 2];
	}
	else {
		cout << mas[(a / 2) + 1] << endl;
		cout << mas[(a / 2) - 1] << endl;
	}
}
Leave a Comment