Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string input = Console.ReadLine();
- int sum = 0;
- for (int i = 0; i < input.Length; i++)
- {
- sum += int.Parse(input[i].ToString());
- }
- Console.WriteLine(sum);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement