Untitled

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

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