Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sing System;
- namespace ConsoleApp7
- {
- class Program1
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- int sum = 0;
- for (int i = 0; i < input.Length; i++)
- {
- int currentNumber = (int)Char.GetNumericValue(input[i]);
- sum += currentNumber;
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement