//Autor: Artur Czekalski (Sator) www.epokaY.net/artur artur@epokaY.net import std.stdint; //int64_t import std.c.windows.windows; //GetTickCount import std.stdio; //writefln char gBufor[256]; //--------------------------------------------------------------------------- int64_t NWD(int64_t a, int64_t b) //najwiekszy wspolny dzielnik {if (a==0 && b==0) return 1; int64_t temp; while (b) {temp = b; b = a%b; a = temp; } return a; } //--------------------------------------------------------------------------- int64_t NWW(int64_t a, int64_t b) //najmniejsza wspolna wielokrotnosc {return a*b / NWD(a,b); } //=========================================================================== int main(char[][] args) { int64_t i, w, max = 0; int czas; czas = GetTickCount(); for (i=1; i<=10000000; ++i) {w = NWW(902337203685-i, i); if (w > max) max = w; } czas = GetTickCount() - czas; writefln("max=", max); writef("\nDigitalMars D v0.162/2.0: Czas=%d", czas); getchar(); return 0; }