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