Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <clocale>
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int n = 0;
- int i = 1;
- int counter = 0;
- printf("Введите число элементов последовательности: ");
- scanf_s("%d", &n);
- printf("\n");
- while (i <= n)
- {
- int a = 0;
- printf("Введите элемент последовательности А: ");
- scanf_s("%d", &a);
- printf("\n");
- if ((i % 2 == 0) && a & 1)
- {
- counter++;
- }
- i++;
- }
- printf("Чисел, удовлетворяющих условию: %d", counter);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement