TodorMitev

Task02

Dec 4th, 2011
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Task02
  7. {
  8.     class Task02
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             byte[] numbers = new byte[5];
  13.             for (int i = 0; i < 5; i++)
  14.             {
  15.                 numbers[i] = byte.Parse(Console.ReadLine());
  16.             }
  17.             int result=0;
  18.             for (int i = 1;  ; i++)
  19.             {
  20.                 int count = 0;
  21.                 for (int j = 0; j < numbers.Length; j++)
  22.                 {
  23.                     if (i % numbers[j] == 0)
  24.                     {
  25.                         count++;
  26.                     }
  27.                 }
  28.                 if (count >= 3)
  29.                 {
  30.                     result = i;
  31.                     Console.WriteLine(result);
  32.                     break;
  33.                 }
  34.             }
  35.         }
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment