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