Advertisement
Sephinroth

prac 4 ex 6

Oct 6th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _4._4
  7. {
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             Console.Write("Введите n: ");
  13.             int n = int.Parse(Console.ReadLine());
  14.             for (int i = n-1; i > 0; --i)
  15.             {
  16.                 if (n % i == 0)
  17.                 {
  18.                     Console.Write("{0}", i);
  19.                     break;
  20.                 }
  21.             }
  22.                 Console.ReadKey();
  23.            
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement