Advertisement
Lyubohd

Вариант-4-Задача-3

Feb 3rd, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ExamPractice
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string text = Console.ReadLine();
  10.  
  11.             int charsInText = text.Length;
  12.             Console.WriteLine("Броят на символите в текста е: " + charsInText);
  13.  
  14.             int digitsCount = 0;
  15.             foreach (char ch in text)
  16.             {
  17.                 if (Char.IsDigit(ch))
  18.                 {
  19.                     digitsCount++;
  20.                 }
  21.                
  22.             }
  23.             Console.WriteLine("Броят на цифрите в текста е: " + digitsCount);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement