Bob103

C#_String(I-9)

Oct 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace ConsoleApplication1
  5. {
  6.    class Program
  7.     {
  8.         private static void Main()
  9.         {
  10.             string text = Console.ReadLine();
  11.             var kol = 0;
  12.             for (int i = 0; i < text.Length; i++)
  13.             {
  14.                 if (Char.IsDigit(text,i))
  15.                 {
  16.                     kol++;
  17.                 }
  18.             }
  19.             Console.WriteLine(kol.ToString());
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment