Advertisement
semkaegor4ik

IV 6 3

Sep 23rd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 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. class Program
  7. {
  8.     static void Main()
  9.     {
  10.         Console.Write("N:= ");
  11.         int n = int.Parse(Console.ReadLine());
  12.         for(int i= Convert.ToInt32(Math.Sqrt(n))+1;i>1;i--)
  13.             if (n % i == 0)
  14.             {
  15.                 Console.WriteLine("Наибольший делитель: " + i);
  16.                 break;
  17.             }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement