Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
264 B
0
Indexable
Never
#include <iostream>

using namespace std;

int main() {
	setlocale(LC_ALL, "Russian");
	int mas[100], n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> mas[i];
		if (mas[i + 1] % 2 == 0 and mas[i - 1] % 3 == 0) {
			cout << i + 1 << ' ';
		}
	}
}
Leave a Comment