fork(1) download
  1. using System; using System.Text; // PRIME_mult.cs DANILIN
  2. namespace prime // rextester.com/VBXFL2777
  3. { class Program
  4. { static void Main(string[] args)
  5. { var start = DateTime.Now; int f=0; int j=2; int q=0;
  6. Random rand = new Random(); // long p = 2147483648-1;
  7. long p = rand.Next(Convert.ToInt32(Math.Pow(2, 22))-1);
  8. long s = Convert.ToInt32(Math.Pow(p,0.5));
  9. while (f < 1)
  10. { if (j >= s)
  11. { f=2; }
  12. if (p % j == 0)
  13. { q=1; Console.WriteLine("{0} {1} {2}",p,j,Convert.ToInt32(p/j));}
  14. j++;
  15. }
  16. if (q != 1) { Console.WriteLine("Prime {0} BillionS", p); }
  17. var finish = DateTime.Now;
  18. Console.WriteLine(finish - start);
  19. Console.ReadKey();
  20. }}}
Runtime error #stdin #stdout #stderr 0.09s 33760KB
stdin
Standard input is empty
stdout
3580385 5 716077
3580385 157 22805
3580385 785 4561
00:00:00.0252388
stderr
Unhandled exception. System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
   at System.ConsolePal.ReadKey(Boolean intercept)
   at System.Console.ReadKey()
   at prime.Program.Main(String[] args) in /home/CkEgoS/Project/Program.cs:line 19