Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Nightmare
- {
- static void Main()
- {
- string input = Console.ReadLine();
- string[] splitInput = input.Select(c => c.ToString()).ToArray();
- long[] array = Array.ConvertAll(splitInput, long.Parse);
- long sum = 0;
- long oddNumbers = 0;
- for (int i = 0; i < array.Length; i++)
- {
- if (i % 2 != 0)
- {
- oddNumbers += 1;
- sum += array[i];
- }
- }
- Console.Write(oddNumbers + " " + sum);
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement