Untitled
#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