Untitled

 avatar
unknown
c_cpp
2 years ago
383 B
2
Indexable
#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];
	}
}
Editor is loading...
Leave a Comment