Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- class NightmareOnCodeStreet
- {
- static void Main()
- {
- string input = Console.ReadLine();
- int count = 0;
- BigInteger sum = 0;
- for (int i = 0; i < input.Length; i++)
- {
- if (i % 2 == 1)
- {
- if (input[i] > 47 && input[i] < 58)
- {
- sum += (input[i] - 48);
- count++;
- }
- }
- }
- Console.Write("{0} {1}", count, sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement