Advertisement
AmidamaruZXC

Untitled

Feb 7th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Task112159
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int number = int.Parse(Console.ReadLine()); // Считываем число
  14.             int count = 0; // Счетчик цифр числа
  15.             while(number > 0) // Пока число > 0
  16.             {
  17.                 number /= 10; // Делим на 10, тем самым сокращая на 1 цифру
  18.                 count++; // Увеличиваем счетчик
  19.             }
  20.             if (count == 3) // Если 3 цифры, то YES
  21.                 Console.WriteLine("YES");
  22.             else
  23.                 Console.WriteLine("NO");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement