Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
458 B
0
Indexable
Never
#include <iostream>

	using namespace std;

	int main() {
		int mas[100];
		int d=0;
		int s;
		int max0=0, max1=0;
		for (int i = 0; i < 100; i++) {
			cin >> mas[i]; 
			d++;
				if (mas[i] == 0) {
					max0++;
				}
				if (mas[i] == 1) {
					max1++;
				}
				if (mas[i] == -1) {
					break;
				}
				if (d % 3 == 0) {
					s = d / 2;
				}
				if (d % 2 == 0) {
					s = (d + 1) / 2;
				}
			
	}
		cout << s << endl;
}
Leave a Comment