Èíòåëëåêòóàëüíûå èíôîðìàöèîííûå ñèñòåìû

         

Ôîðìàëèçîâàòü çàäà÷ó.


Äëÿ ýòîé öåëè èñïîëüçóåì 5-þ ôóíêöèþ 5-ãî ðåæèìà 1-é ïîäñèñòåìû ñèñòåìû "Ýéäîñ" (ðåàëüíûé èñõîäíûé òåêñò ïðîãðàììû ïðèâîäèòñÿ íèæå).

***************************************************************

*** Ôîðìèðîâàíèå ìîäåëè äëÿ èññëåäîâàíèÿ ñâîéñòâ ÷èñåë ********

*** Ëóöåíêî Å.Â., 02/26/04 11:34am ****************************

***************************************************************

FUNCTION Div_chis()

scr_start=SAVESCREEN(0,0,24,79)

SHOWTIME(0,58,.T.,"rb/n")

Titul(.T.)

Mess = "=== ÃÅÍÅÐÀÖÈß ÈÑÕÎÄÍÛÕ ÄÀÍÍÛÕ ÄËß ÌÎÄÅËÈ ÈÑÑËÅÄÎÂÀÍÈß ÑÂÎÉÑÒ ×ÈÑÅË ==="

@5,40-LEN(Mess)/2 SAY Mess COLOR "rg+/rb"

*    0123456789012345678901234567890123456789012345678901234567890123456789012345678

*    0         10        20        30        40        50        60        70

@10,24 SAY                  "Çàäàéòå ìàêñèìàëüíîå ÷èñëî: #####" COLOR "w+/rb"

N_Obj = 99

@10,52 GET N_Obj PICTURE "#####" COLOR "rg+/r"



SET CURSOR ON;READ;SET CURSOR OFF

IF LASTKEY()=27

   RESTSCREEN(0,0,24,79,scr23)

   RETURN

ENDIF

*** Ôîðìèðîâàíèå ñïðàâî÷íèêà ïåðâè÷íûõ ïðèçíàêîâ

A_Pr  := {}

FOR j=1 TO N_Obj

    AADD(A_Pr, "Äåëèòñÿ íà "+ALLTRIM(STR(j,4)))

NEXT

FOR j=1 TO N_Obj

    AADD(A_Pr, "Íå äåëèòñÿ íà "+ALLTRIM(STR(j,4)))

NEXT

FOR j=1 TO N_Obj

    AADD(A_Pr, "Äåëèòåëåé: "+ALLTRIM(STR(j,4)))

NEXT

USE Priz_per EXCLUSIVE NEW

ZAP

FOR j=1 TO LEN(A_Pr)

    APPEND BLANK

    REPLACE Kod  WITH j

    REPLACE Name WITH A_Pr[j]

NEXT

GenNtxPrp(.F.)

CLOSE ALL

*** Ôîðìèðîâàíèå ñïðàâî÷íèêà êëàññîâ ðàñïîçíàâàíèÿ

USE Object EXCLUSIVE NEW

ZAP

FOR j=1 TO N_Obj

    APPEND BLANK

    REPLACE Kod  WITH j

    REPLACE Name WITH ALLTRIM(STR(j,3))

NEXT

GenNtxObj(.F.)

CLOSE ALL

*** Ôîðìèðîâàíèå îáó÷àþùåé âûáîðêè

USE ObInfZag EXCLUSIVE NEW;ZAP

USE ObInfKpr EXCLUSIVE NEW;ZAP

FOR s=1 TO N_Obj

    SELECT ObInfZag

    APPEND BLANK

    REPLACE Kod_ist  WITH s

    REPLACE Name_ist WITH ALLTRIM(STR(s,4))


    REPLACE Obj_1    WITH s

    SELECT ObInfKpr

    APPEND BLANK

    REPLACE Kod_ist  WITH s

    p=0                   && Ïîçèöèÿ äëÿ çàïèñè â ÁÄ

    N_Del=0               && Êîë-âî äåëèòåëåé

    *** Ïðîâåðêà äåëèìîñòè

    FOR j=1 TO N_Obj

        IF s-j*int(s/j) = 0

           Kod = j

           ++N_Del

           IF p+1 <= 11

              FIELDPUT(++p+1, Kod)

           ELSE

              APPEND BLANK

              REPLACE Kod_ist  WITH s

              p=0

              FIELDPUT(++p+1, Kod)

           ENDIF

        ENDIF

    NEXT

    ************ Çàíåñåíèå êîëè÷åñòâà äåëèòåëåé

    IF p+1 <= 11

       FIELDPUT(++p+1, N_Del+2*N_Obj)

    ELSE

       APPEND BLANK

       REPLACE Kod_ist  WITH s

       p=0

       FIELDPUT(++p+1, N_Del+2*N_Obj)

    ENDIF

    *** Ïðîâåðêà íå äåëèìîñòè

    FOR j=1 TO N_Obj

        IF s-j*int(s/j) <> 0

           Kod = j+N_Obj

           IF p+1 <= 11

              FIELDPUT(++p+1, Kod)

           ELSE

              APPEND BLANK

              REPLACE Kod_ist  WITH s

              p=0

              FIELDPUT(++p+1, Kod)

           ENDIF

        ENDIF

    NEXT

NEXT

GenNtxOin(.F.)

@24,0 SAY REPLICATE("-",80) COLOR "rb/n"

Mess = " ÏÐÎÖÅÑÑ ÃÅÍÅÐÀÖÈÈ ØÊÀË È ÎÁÓ×ÀÞÙÅÉ ÂÛÁÎÐÊÈ ÇÀÂÅÐØÅÍ ÓÑÏÅØÍÎ !!! "

@24,40-LEN(Mess)/2 SAY Mess COLOR "rg+/rb"

INKEY(0)

RESTSCREEN(0,0,24,79,scr_start)

SHOWTIME()

RETURN


Ñîäåðæàíèå ðàçäåëà