Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp9
- {
- class Program
- {
- static void Main(string[] args)
- {
- var numbers = Console.ReadLine().Split(' ');
- var findTheOdd = new int[numbers.Length];
- for (int i = 0; i < numbers.Length; i++)
- {
- findTheOdd[i] = int.Parse(numbers[i]);
- }
- int oddCounter = 0;
- for (int i = 0; i < findTheOdd.Length; i++)
- {
- if ((findTheOdd[i] % 2 == 1) && (i % 2 == 1) || (findTheOdd[i] % 2 == -1) && (i % 2 == 1))
- {
- oddCounter++;
- Console.WriteLine($"Index {i} -> {findTheOdd[i]}");
- } else
- {
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement