fork 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 = 1048773993 ;
  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 33788KB
stdin
Standard input is empty
stdout
1048773993 3 349591331
1048773993 337 3112089
1048773993 607 1727799
1048773993 1011 1037363
1048773993 1709 613677
1048773993 1821 575933
1048773993 5127 204559
00:00:00.0250366
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/qmMxEo/Project/Program.cs:line 19