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