Èíôîðìàòèêà

       

Ðåøåíèå çàäà÷ íà ÝÂÌ


Ðåøåíèå çàäà÷ äîëæíî íà÷èíàòüñÿ ñ èõ òî÷íîé ïîñòàíîâêè. Ïîñòàíîâêà çàäà÷ - ýòî ÷åòêîå âûäåëåíèå òîãî, ÷òî òðåáóåòñÿ, è òîãî, ÷òî äàíî:

Ïîñòàíîâêà

Çàäà÷à



 

òðåáóåòñÿ?

      

äàíî?

Ñëåäóþùèé ýòàï - îïðåäåëåíèå ñïîñîáà ðåøåíèÿ çàäà÷è. Ñïîñîá ðåøåíèÿ - ýòî íàáîð äåéñòâèé, ïîçâîëÿþùèõ ïîëó÷èòü òðåáóåìîå èç èñõîäíîãî:

Ðåøåíèå

Çàäà÷à

 

èñõîäíîå  ® ñïîñîá ® ðåçóëüòàòû

Ðåçóëüòàò ïðàâèëüíûé, åñëè îí îòâå÷àåò òðåáîâàíèÿì. Ïîëó÷åíèå ðåçóëüòàòîâ - ãëàâíîå â ðåøåíèè ëþáûõ çàäà÷. Îòñóòñòâèå èëè íåïðàâèëüíîñòü ðåçóëüòàòîâ ãîâîðèò î íåóñïåõå äåÿòåëüíîñòè.

Ðåçóëüòàò íåïðàâèëüíûé, åñëè îí íå ñîîòâåòñòâóåò òðåáîâàíèÿì. Îäíàêî ïðè îòñóòñòâèè ÷åòêèõ òðåáîâàíèé íåâîçìîæíî îäíîçíà÷íî ñóäèòü î ïðàâèëüíîñòè èëè íåïðàâèëüíîñòè ðåçóëüòàòîâ.

Ïðè ðåøåíèè íà ÝÂÌ ïîñòàíîâêà çàäà÷ ïðåäïîëàãàåò ïðåäñòàâëå­íèå òðåáóåìîãî è èñõîäíîãî â âèäå äàííûõ. Ñïîñîáû ðåøåíèÿ çàäà÷ íà ÝÂÌ â òàêîé ïîñòàíîâêå äîëæíû áûòü ïðåäñòàâëåíû ñîîòâåòñò­âóþùèìè àëãîðèòìàìè è ïðîãðàììàìè îáðàáîòêè äàííûõ.

Ðåøåíèå íà ÝÂÌ

Çàäà÷à

¯

Ïðîãðàììà

¯

 äàííûå ® ÝÂÌ ® ðåçóëüòàòû

Ïðè îòñóòñòâèè ãîòîâûõ ïðîãðàìì äëÿ ðåøåíèÿ çàäà÷ âîçíèêàåò ïðîáëåìà ñîçäàíèÿ ñîîòâåòñòâóþùèõ àëãîðèòìîâ è ïðîãðàìì.  ëþáîì ñëó÷àå íåîáõîäèìî ïîäîáðàòü è îïðåäåëèòü ñïîñîáû, ìåòîäû è ñðåä­ñòâà äëÿ ðåøåíèÿ ïîñòàâëåííûõ çàäà÷.

Ñèñòåìàòè÷åñêèé ïîäõîä ê ñîñòàâëåíèþ ïðîãðàìì ïðåäïîëàãàåò â êà÷åñòå ïåðâîãî ýòàïà ñîñòàâëåíèå ñïåöèôèêàöèé - îïèñàíèé ôîðì ââîäà è õðàíåíèÿ äàííûõ â ÝÂÌ, à òàêæå ïîëó÷åíèÿ è âûâîäà ðåçóëüòàòîâ. Ýòè ñïåöèôèêàöèè â äàëüíåéøåì áóäóò èñïîëüçîâàòüñÿ äëÿ îöåíêè ïðàâèëüíîñòè ñîçäàííûõ ïðîãðàìì.

Äëÿ äèàëîãîâûõ ïðîãðàìì â ðîëè òàêèõ ñïåöèôèêàöèé âûñòóïàþò ñöåíàðèè äèàëîãà - ïîëíûå îïèñàíèÿ ðåçóëüòàòîâ è ïðàâèë ðàáîòû ñ ÝÂÌ ïðè ðåøåíèè ïîñòàâëåííûõ çàäà÷. Òîëüêî ïîñëå ñîçäàíèÿ òàêèõ ñïåöèôèêàöèé äîëæíû ñîñòàâëÿòüñÿ ñîîòâåòñòâóþùèå èì àëãîðèòìû è ïðîãðàììû.

Ñîñòàâëåíèå ïðîãðàìì

çàäà÷à    ®   ñïîñîáû

¯                       ¯                


ñöåíàðèé   ® àëãîðèòìû   
¯                       ¯             
 ÝÂÌ    ¬  ïðîãðàììà
Ïðèâåäåííàÿ ñõåìà ïðåäñòàâëÿåò îñíîâíîé ïðèíöèï ñèñòåìàòè­÷åñêèõ ìåòîäîâ ñîñòàâëåíèÿ àëãîðèòìîâ è ïðîãðàìì äëÿ ðåøåíèÿ ðàçëè÷íûõ ïðèêëàäíûõ çàäà÷ - ýêîíîìè÷åñêèõ, ìàòåìàòè÷åñêèõ, ôèçè÷åñêèõ, èíæåíåðíûõ è ò. ä.
Îñîáåííîñòüþ ñèñòåìàòè÷åñêèõ ìåòîäîâ ÿâëÿåòñÿ âîçìîæíîñòü ïîëíîãî óñòðàíåíèÿ îøèáîê èç àëãîðèòìîâ è ïðîãðàìì. Ïðè ýòîì ïîäõîäå ïðîãðàììû ñâåðÿþòñÿ ñ îïèñàíèÿìè àëãîðèòìîâ, à àëãîðèò­ìû - ñ îïèñàíèÿìè ñöåíàðèåâ è ìåòîäîâ ðåøåíèÿ.
Òàêîé ñèñòåìàòè÷åñêèé ïîäõîä ê ñîñòàâëåíèþ àëãîðèòìîâ è ïðî­ãðàìì ìîæåò ïðèìåíÿòüñÿ ê ðåøåíèþ íà ÝÂÌ ëþáûõ ïðèêëàäíûõ çàäà÷ ñ èñïîëüçîâàíèåì ñàìûõ ðàçëè÷íûõ ÿçûêîâ ïðîãðàììèðîâàíèÿ - Áåéñèê, Ïàñêàëü, Ñè è èì ïîäîáíûå. Ïðèâåäåì ïðèìåðû ñèñòåìàòè­÷åñêîãî ðåøåíèÿ çàäà÷.
Ïåðâàÿ çàäà÷à: ïîäñ÷åò ïëîùàäè òðåóãîëüíèêà ïî äëèíàì ñòîðîí.
                                                           
      a                       b
  c
Ïîñòàíîâêà                                                                                        Ñöåíàðèé

Äàíî: à, b, ñ - äëèíû ñòîðîí,                                                ïëîùàäü òðåóãîëüíèêà
Òðåá.: S - ïëîùàäü òðåóãîëüíèêà,                                        äëèíû ñòîðîí:
Ïðè:   à > 0, b > 0, ñ > 0,                                                                    à =? <à>
           a < b +c, b < a + c, c < a + b.                                                   b =? <b>
                                                                                                            ñ =? <ñ>


Ìåòîä ðåøåíèÿ                                                                              ïëîùàäü = <S>
S =
                                         íåäîïóñòèìû äëèíû
ð = (à + b + ñ)/2
Îáðàòèòå âíèìàíèå: â ïîñòàíîâêå çàäà÷è â èñõîäíûå óñëîâèÿ âêëþ­÷åíû ñèòóàöèè, êîãäà ðåøåíèå ìîæåò íå ñóùåñòâîâàòü.


À èìåííî, çäåñü óêàçàíû òðè íåðàâåíñòâà òðåóãîëüíèêà è óñëîâèÿ ïîëîæèòåëü­íîñòè äëèí ñòîðîí. Ïðè íàðóøåíèè ýòèõ óñëîâèé òðåóãîëüíèêà ïðîñòî íå ñóùåñòâóåò è òåì áîëåå íåëüçÿ ãîâîðèòü î åãî ïëîùàäè.
Äëÿ íàäåæíîñòè ïðîãðàìì òàêîãî ðîäà ñèòóàöèè (êîãäà íåò ðåøå­íèé) äîëæíû áûòü ïðåäóñìîòðåíû â ñöåíàðèè äèàëîãà.  ýòèõ ñëó÷àÿõ â ñöåíàðèé íåîáõîäèìî âêëþ÷èòü ñîîáùåíèÿ ñ äèàãíîñòèêîé ïðè÷èí îòêàçîâ: îòñóòñòâèå ðåøåíèé, íåäîïóñòèìîñòü äàííûõ, íåêîððåêò­íîñòü êîìàíä, ïðîòèâîðå÷èâîñòü ôàêòîâ è ò. ï.
Àëãîðèòì                                                                  Ïðîãðàììà
àëã «ïëîùàäü òðåóãîëüíèêà»                                 ' ïëîùàäü òðåóãîëüíèêà
íà÷                                                                              cls
âûâîä («ïëîùàäü òðåóãîëüíèêà»)                          ? «ïëîùàäü òðåóãîëüíèêà»
âûâîä («äëèíû ñòîðîí:»)                                        ? «äëèíû ñòîðîí:»
çàïðîñ («à=», a)                                                         input «a=», a
çàïðîñ («b=», b)                                                         inpnt «b=», b
çàïðîñ («ñ=», ñ)                                                         input «c=», c
åñëè íå (à > 0 è b > 0 è ñ > 0) òî                             if a<=0 or b<=0 or c<=0 then
âûâîä («íåäîïóñòèìû äëèíû»)                             ? «íåäîïóñòèìû äëèíû»
èíåc íå (à < b
+ ñ è b < à +                                       elseif not (a < b+ ñ and b < à + ñ
+ñ è ñ<à+b)òî                                                          and ñ < à + b) then
âûâîä («íåäîïóñòèìû äëèíû»)                             ? «íåäîïóñòèìû äëèíû»
èíà÷å                                                                          else
ð := (à + b + ñ)/2                                                       ð = (à+ b +ñ)/2
S :=
                  S = sqr (p*(p-a)*(p-b)*(p-c))
âûâîä («ïëîùàäü=», S)                                           ? «ïëîùàäü=», S


âñå                                                                               end if
          êîí                                                                             end
 
Ðàññìîòðåííûé ïðèìåð ñëóæèò èëëþñòðàöèåé ïîñòàíîâêè çàäà÷è, â êîòîðîé âûäåëåíû êàê òðåáóåìûå è èñõîäíûå äàííûå, òàê è óñëîâèÿ äîïóñòèìîñòè èñõîäíûõ äàííûõ. Òàêàÿ ïîñòàíîâêà çàäà÷è ïîçâîëÿåò çàðàíåå âûäåëèòü âñå ñëó÷àè è ñèòóàöèè íåäîïóñòèìîñòè äàííûõ, ÷òî â äàëüíåéøåì ïîíàäîáèòñÿ ïðè ñîñòàâëåíèè ñöåíàðèÿ äèàëîãà ñ êîìïüþòåðîì.
 îáùåì ñëó÷àå ìàòåìàòè÷åñêàÿ ïîñòàíîâêà
çàäà÷ äîëæíà ñîäåð­æàòü íå òîëüêî óñëîâèÿ äîïóñòèìîñòè äàííûõ, íî è òî÷íîå îïèñàíèå òðåáîâàíèé ê ðåçóëüòàòàì:
1) äàíî: ïåðå÷åíü èñõîäíûõ äàííûõ;
2) òðåá: ïåðå÷åíü òðåáóåìûõ äàííûõ;
3) ãäå: òðåáîâàíèÿ ê ðåçóëüòàòàì;
4) ïðè: óñëîâèÿ äîïóñòèìîñòè äàííûõ.
Âòîðàÿ çàäà÷à: îïðåäåëåíèå ñðåäíåãî àðèôìåòè÷åñêîãî ïîñëåäî­âàòåëüíîñòè èç N ÷èñåë õ1, õ2, ..., õN. Ïðèâåäåì ïîñòàíîâêó, ìåòîä ðåøåíèÿ è ñöåíàðèé äèàëîãà äëÿ ðåøåíèÿ ýòîé çàäà÷è.
Ïîñòàíîâêà çàäà÷è                                                                     Ñöåíàðèé

Äàíî: N - êîëè÷åñòâî ÷èñåë,                                                ñðåäíåå N ÷èñåë
x1, õ2, .., õN - ÷èñëà,                                                                ÷èñåë =? <N>
 Òðåá.: s - ñðåäíåå N ÷èñåë.                                                                                        *
 Ãäå: s = (õ1, + õ2 +...+ õN )/ N.                                                               1: <õ1>
Ïðè: N > 0.                                                                                         2: <õ2>
………..
Ìåòîä ðåøåíèÿ                                                                                 N: <õN>


       S0 = 0                                                                               ñðåäíåå = <s>
              Sk = Sk-1 + õk                   
              [k = 1, ..., N]                                                             íåäîïóñòèìî N


       s = SN / N
Îáðàòèòå âíèìàíèå: ìåòîä âû÷èñëåíèÿ
ñðåäíåãî N ÷èñåë çäåñü îïèñàí ÷åðåç ïîäñ÷åò ñóììû ÷èñåë. Ïðàâèëüíîñòü ìåòîäà ìîæåò áûòü ïðîâåðåíà ïî îòíîøåíèþ ê òðåáîâàíèÿì ïîñòàíîâêè çàäà÷è.
Ïðèâåäåì àëãîðèòì è ïðîãðàììó îáðàáîòêè äàííûõ, ñîñòàâëåí­íûå â òî÷íîì ñîîòâåòñòâèè ñ âûáðàííûì ñöåíàðèåì è ìåòîäîì ðåøåíèÿ:
Àëãîðèòì                                                                  Ïðîãðàììà
àëã «ñðåäíåå àðèôìåòè÷åñêîå»                             ' ñðåäíåå àðèôìåòè÷åñêîå
íà÷                                                                              cls
âûâîä («ñðåäíåå N ÷èñåë»)                                     ? «ñðåäíåå N ÷èñåë»
çàïðîñ («÷èñåë=», N)                                                input «÷èñåë=», N
S
:= 0                                                                          S = 0
åñëè N <= 0 òî                                                         if N <= 0 then
âûâîä («íåäîïóñòèìî N»)                                       ? «íåäîïóñòèìî N»
èíåc N > 0 òî                                                           elseif N > 0 then
îò k = 1 äî N öèêë                                                   for k = 1 to N
âûâîä (k, «:»)                                                           ? k, «:»
çàïðîñ (x)                                                                 input x
S
:= S + x                                                                  S = S + x
êöèêë                                                                         next k
s
:= S/N                                                                      s = S/N
âûâîä («ñðåäíåå =», s)                                             ? «ñðåäíåå=», s
âñå                                                                             end if
êîí                                                                              end
Ïðè ðåøåíèè ñëîæíûõ çàäà÷ äëÿ ïðîâåðêè ïðàâèëüíîñòè ñîñòàâ­ëÿåìûõ àëãîðèòìîâ è ïðîãðàìì îáÿçàòåëüíû íå òîëüêî ìàòåìàòè÷åñ­êîå îïèñàíèå ïîñòàíîâêè çàäà÷, íî è îïèñàíèå âûáðàííûõ ìåòîäîâ ðåøåíèÿ.


Ïðèâåäåì ïðèìåð ðàçðàáîòêè ïðîãðàììû îáðàáîòêè äàííûõ ñ ìàòåìàòè÷åñêîé ïîñòàíîâêîé çàäà÷è è ïîëíûì îïèñàíèåì ìåòîäà ðåøåíèÿ.
            Òðåòüÿ çàäà÷à:
îïðåäåëåíèå ñàìîãî ëåãêîãî èç ó÷åíèêîâ ïî äàííûì èç òàáëèöû, ñîäåðæàùåé N ñòðîê:
ôàìèëèÿ                    ðîñò                            âåñ

Èâàíîâ
185
85
Ïåòðîâà
165
65
Ñèäîðîâ
170
80

Ïîñòàíîâêà çàäà÷è                                                                                        Ñöåíàðèé

Äàíî: (D1, ..., DN) - äàííûå ó÷åíèêîâ.                                                 Äàííûå îá ó÷åíèêàõ
ãäå D = [Fam, R,V] - ñîñòàâ äàííûõ,                                                          ôàìèëèÿ âåñ
Fam - ôàìèëèÿ, R - ðîñò, V -âåñ
Òðåá.: Famm
- ôàìèëèÿ ó÷åíèêà.                                                                  <Fam1> <V1>                *
Ãäå: m: Vm = Min (V1
..., VN).                                                                               …  …
Ïðè: N > 0.                                                                                                     <FàmN> <VN>


Ìåòîä ðåøåíèÿ                                                                                             ñàìûé ëåãêèé:
Min (V1,.. Vn):                                                                                                Fam m > <Vm >
min = V1
îò k = 1 äî ï öèêë                                                                             Ïðåäñòàâëåíèå äàííûõ
åñëè Vk < min òî                                                                                dan: 'äàííûå ó÷åíèêîâ:
min: = Vk                                                                                             data «Èâàíîâ», «Âîâà», 180,80
êöèêë                                                                                                  data «»,»»,0 ,0
Âûáðàííîìó ñöåíàðèþ, ìåòîäó ðåøåíèÿ è ïðåäñòàâëåíèþ äàí­íûõ ñîîòâåòñòâóþò ñëåäóþùèå àëãîðèòì è ïðîãðàììà íà Áåéñèêå.


Àëãîðèòì                                                                              Ïðîãðàììà
àëã «ñàìûé ëåãêèé ó÷åíèê»                                                            ' ñàìûé ëåãêèé ó÷åíèê
íà÷                                                                                          cls
âûâîä («Äàííûå îá ó÷åíèêàõ»)                                         ? «Äàííûå îá ó÷åíèêàõ»
âûâîä («ôàìèëèÿ âåñ»)                                                       ? «ôàìèëèÿ âåñ»
N: = 0                                                                                    n = 0
öèêë                                                                                      do
÷òåíèå (Fam, r, v)                                                               read famS, r, v
ïðè Fam = «» âûõîä                                                           if fam$ = «» then exit do
âûâîä (Fam, v)                                                                     ? fam$, v, r
N:=N+1                                                                                n = n+1
åñëè N == 1 èëè V < Vmin òî                                           if n=l or v < vmin then
Vmin: =
V                                                                             vmin = v
Fmin: =
Fam                                                                        fmin$ = fam$
âñå                                                                                          end if
êöèêë                                                                                    loop
âûâîä («ñàìûé ëåãêèé:»)                                                   ? «ñàìûé ëåãêèé:»
âûâîä (Fmin, Vmin)                                                            ? fmin$, vmin
êîí                                                                                          end
 îáùåì ñëó÷àå ñèñòåìàòè÷åñêèé ïîäõîä ê ðåøåíèþ çàäà÷ íà ÝÂÌ òðåáóåò äëÿ ïðîâåðêè ïðàâèëüíîñòè àëãîðèòìîâ è ïðîãðàìì íå òîëüêî ìàòåìàòè÷åñêîé ïîñòàíîâêè çàäà÷, íî è îáÿçàòåëüíîãî îïèñàíèÿ âûáðàííûõ ìåòîäîâ ðåøåíèÿ.


Ñèñòåìàòè÷åñêèé ïîäõîä:
çàäà÷à              ®      ñïîñîáû
¯                               ¯
ïîñòàíîâêà    ®     ìåòîäû
¯                               ¯
ñöåíàðèé          ®     àëãîðèòìû
¯                                ¯
ÝÂÌ                ¬       ïðîãðàììà
Ðàññìîòðèì ïðèìåð ñèñòåìàòè÷åñêîãî ñîñòàâëåíèÿ àëãîðèòìà è ïðîãðàììû äëÿ ðåøåíèÿ íà ÝÂÌ äîñòàòî÷íî ñëîæíîé çàäà÷è îáðà­áîòêè äàííûõ.
×åòâåðòàÿ çàäà÷à: Îïðåäåëèòü ñóììû ýëåìåíòîâ ñòîëáöîâ â ìàòðèöå Anxm:

Ïðèâåäåì îáîáùåííóþ ïîñòàíîâêó çàäà÷è è îïèñàíèå ñîîòâåòñò­âóþùèõ îáùåãî ìåòîäà ðåøåíèÿ è ñöåíàðèÿ äèàëîãà.
Ïîñòàíîâêà çàäà÷è                                                                Ñöåíàðèé

Äàíî:                                                                          Ìàòðèöà <N>´<M>
(a11 … a1N)                                                                   < a11> ... < a1N >
(... ... ... ) - ìàòðèöà Anxm                                              ... ... ...
(aMl
… aMN)                                                                 < aMl > … < aMN
>
Òðåá.:                                                                          Ñóììû ýëåìåíòîâ:
(S1
..., SN) - ñóììû ñòîëáöîâ                                     <S1> ... <SN>
Ãäå:                              
      Si
= ài1 + ...+ àiM
      [i = (1… N)]
Ïðè: N > 0, Ì > 0.
Ìåòîä âû÷èñëåíèé                                     Ïðåäñòàâëåíèå äàííûõ
   sk0 = 0 matr:                                               ' ìàòðèöà Anm:
       sk1 = ak1
+ sk1-1                                           data 3, 4
       [1 = (1 ... M)]                                           data I, 2, 3, 4
   Sk = SkN                                                        data 0, 1, 2, 3
  [k = (1 ... N)]                                                 data 0, 0, 1, 2
 ïðåäëàãàåìîé íèæå ïðîãðàììå äëÿ ïðåäñòàâëåíèÿ ìàòðèö èñ­ïîëüçóþòñÿ îïåðàòîðû data.  ïåðâîì èç ýòèõ îïåðàòîðîâ çàïèñàíû ðàçìåðû, à â êàæäîì ïîñëåäóþùåì îïåðàòîðå - ñòðîêè ìàòðèöû:


Àëãîðèòì                                                                  Ïðîãðàììà
àëã « ñóììà ñòðîê ìàòðèöû»                                ' ñóììà ñòðîê ìàòðèöû
íà÷                                                                              cls
÷òåíèå (ï, ò) .                                                        read n, m
åñëè ï > 0 è ò > 0 òî                                             if N > 0 and Ì > 0 then
ìàññèâ À[1:ï,1:ò]                                                   dim A (N,M)
ìàññèâ S[1:n]                                                           dim S(n)
ââîä-âûâîä_ìàòðèöû                                             gosub vvod 'ââîä-ìàòðèöû
ñóììèðîâàíèå_ñòðîê                                             gosub sum 'ñóììèðîâàíèå
îò k = 1 äî ï öèêë                                                   for k= 1 to n
âûâ (s[k])                                                                   ? s[k]
êöèêë                                                                         next k
âñå                                                                             end if
êîí                                                                              end
àëã «ñóììèðîâàíèå ñòðîê»                                                sum: 'ñóììèðîâàíèå ñòðîê
íà÷                                                                              ' íà÷
îò k = 1 äî N öèêë                                                   for k = 1 to n
s[k] := 0                                                                      s[k] = 0
îò l = 1 äî Ì öèêë                                                   for I = 1 to m
s[k] := s[k] + A[k,l]                                                    s[k] = s[k] + a[k,l]
êöèêë                                                                         next I
êöèêë                                                                         next k
êîí                                                                              return


àëã «ââîä-âûâîä_ìàòðèöû»                                   vvod: 'ââîä-âûâîä_ìàòðèöû
íà÷                                                                              ' íà÷
âûâîä («Ìàòðèöà», N, «õ», Ì)                               ? «Ìàòðèöà»; m; «õ»; m
îò k = 1 äî N öèêë                                                    for k = 1 to n
îò I = 1 äî Ì öèêë                                                    for l = 1 to m
÷òåíèå (A [k,l])                                                           read A (k,l)
âûâîä (A [k,l])                                                              ? A (k,l)
êöèêë                                                                           next 1     
íîâ_ñòðîêà                                                                ?
êöèêë                                                                         next k
êîí                                                                              return
 
 î ï ð î ñ û
 
1. ×òî òàêîå ïîñòàíîâêà çàäà÷è?
2. ×òî âêëþ÷àåòñÿ â ïîñòàíîâêó çàäà÷?
3. ×òî òàêîå ñïîñîá ðåøåíèÿ?
4. ×òî òàêîå ìåòîä ðåøåíèÿ?
5. Êàêîâ ïîðÿäîê ðåøåíèÿ íîâûõ çàäà÷?
6. ×òî òàêîå ñèñòåìàòè÷åñêàÿ ðàçðàáîòêà àëãîðèòìîâ è ïðîãðàìì?
Ç à ä à ÷ è
 
1. Ïðèâåäèòå ïîñòàíîâêó çàäà÷è, ñöåíàðèé, àëãîðèòì è ïðîãðàììó ïîäñ÷åòà ñóìì:
à) íå÷åòíûõ ÷èñåë;
á) êâàäðàòîâ öåëûõ ÷èñåë;
â) êóáîâ öåëûõ ÷èñåë.
2. Ïðèâåäèòå ïîñòàíîâêó çàäà÷è, ñöåíàðèé, àëãîðèòì è ïðîãðàììó ïîäñ÷åòà ñóìì:
à) ÷ëåíîâ àðèôìåòè÷åñêîé ïðîãðåññèè;
á) ÷ëåíîâ ãåîìåòðè÷åñêîé ïðîãðåññèè.
3. Äëÿ ïîñëåäîâàòåëüíîñòè ÷èñåë õ1, õ2 ..., õN ïðèâåäèòå ïîñòàíîâêó çàäà÷è, ñîñòàâüòå ñöåíàðèé, àëãîðèòì ðåøåíèÿ è ïðîãðàììó:
à) ïîäñ÷åòà ñóììû âñåõ ÷èñåë;
á) âû÷èñëåíèÿ ñðåäíåãî àðèôìåòè÷åñêîãî ÷èñåë;
â) îïðåäåëåíèÿ íàèáîëüøåãî èç ÷èñåë;
ã) îïðåäåëåíèÿ íàèìåíüøåãî èç ÷èñåë.
4. Äëÿ äàííûõ îá ó÷åíèêàõ, ñîäåðæàùèõ ñâåäåíèÿ îá èõ ðîñòå è âåñå, ïðèâåäèòå ïîñòàíîâêó çàäà÷è, ñîñòàâüòå ñöåíàðèé, àëãîðèòì è ïðîãðàì­ìó îïðåäåëåíèÿ:
à) ñàìîãî âûñîêîãî ó÷åíèêà;                                   ã) ñàìîãî ëåãêîãî ó÷åíèêà;
á) ñàìîãî íèçêîãî ó÷åíèêà;                      ä) ñðåäíèé ðîñò ó÷åíèêîâ;
â) ñàìîãî òÿæåëîãî ó÷åíèêà;                    å) ñðåäíèé âåñ ó÷åíèêîâ.
5. Äëÿ äàííûõ î äíÿõ ðîæäåíèÿ ñâîèõ äðóçåé è ðîäíûõ ïðèâåäèòå ïîñòàíîâêó çàäà÷è, ñîñòàâüòå ñöåíàðèé, àëãîðèòì ðåøåíèÿ è ïðîãðàììó:
à) îïðåäåëåíèÿ ðîâåñíèêîâ;
á) îïðåäåëåíèÿ ëþäåé, ðîäèâøèõñÿ â îäèí äåíü;
â) ñàìîãî ìîëîäîãî èç ñâîèõ äðóçåé è ðîäíûõ;
ã) ñàìîãî ñòàðøåãî èç ñâîèõ ðîäíûõ è äðóçåé.

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