Advertisement
mess0011

ue4_3

Oct 31st, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 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 ConsoleApplication39
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int nr = 0;
  14.             int counter = 0;
  15.             int devision_nr = 0;
  16.             Random r = new Random();
  17.             nr = Convert.ToInt32(Console.ReadLine());
  18.  
  19.             while (nr < 500)
  20.             {
  21.                 Console.WriteLine("Pick a number larger than 500!");              
  22.             }
  23.  
  24.             while (counter < 25 && nr != 1)
  25.             {
  26.                 devision_nr = r.Next(1, 10);
  27.  
  28.                 if (nr % devision_nr == 0)
  29.                 {
  30.                     nr = nr / devision_nr;
  31.                     Console.WriteLine(nr);
  32.                 }
  33.                 counter++;
  34.             }
  35.             Console.ReadLine();
  36.         }
  37.     }
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement