Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SumaCyfr
- {
- class Program
- {
- static void Main(string[] args)
- {
- /* string str = Console.ReadLine();
- uint a= uint.Parse(str);
- uint b=0;
- A:
- b += a % 10;
- a /= 10;
- if (a > 0) goto A;
- Console.WriteLine(b);
- Console.ReadKey(); */
- string str = Console.ReadLine();
- uint a = uint.Parse(str);
- uint b = 0;
- while (true)
- {
- b += a % 10;
- a /= 10;
- if (a <= 0) break;
- }
- Console.WriteLine(b);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement