You are viewing a single comment's thread. Return to all comments →
C#
static void Main(String[] args) { int t = Convert.ToInt32(Console.ReadLine()); for(int a0 = 0; a0 < t; a0++){ int n = Convert.ToInt32(Console.ReadLine()); Test(n, t); } } public static void Test(int n, int t) { int rightNow = n; bool goOut = false; while (goOut is false) { for (int i=1; i<=n; i++) { if (rightNow%i != 0) { rightNow++; break; } if (i == n) { goOut = true; } } } Console.WriteLine(rightNow); }
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #5: Smallest multiple
You are viewing a single comment's thread. Return to all comments →
C#