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