Информатика

Автор: Пользователь скрыл имя, 30 Марта 2010 в 10:32, курсовая работа

Описание работы

ЗАДАНИЕ: Задана действительная матрица размера n*m. Построить матрицу той же размерности, если каждый элемент новой матрицы равен сумме элементов в не заштрихованной области.

Содержание

Задание на курсовую работу…………………………………………………2
Замечания руководителя……………………………………………….……..3
Введение…...………………….……………………………………………….5
1. Теоретическая часть…………….………………………………………….6
1.1 Стандартные типы данных……….……………………………….……6
1.2 Массивы в языке программирования Pascal…….…………………….9
1.3 Процедуры и функции…………………………………………….…....10
1.4 Графические возможности языка программирования Pascal………..13
2. Экспериментальная часть………………………………………………….15
2.1 Постановка задачи……………………………………………….……..15
2.2 Алгоритм решения задачи……………………………………….….....15
2.3 Описание диалога с пользователем……………………………….…..25
2.4 Контрольный пример……………………………………………….….26
Заключение…………………………………………………………………….27
Список литературы……………………………………………………………28
Приложение……………………………………………………………………29

Работа содержит 1 файл

Курсяк.doc

— 508.00 Кб (Скачать)

                                                OutTextXY (20+j*40,40+K*30,Strin1);

                                                End;

                             Writeln;

                             K:=K+1;

                             u1:=u1+1;

                      End;

      K:=0;

      u:=Trunc(n/2)+1;

      u1:=Trunc(m/2)+1;

      K:=u1-1;

      For i:=u to n do

                     Begin

                           For j:=u1 to m do

                                           Begin

                                                S4:=S4+W[i,j];

                                                Str(W[i,j],Strin1);

                                                OutTextXY (20+j*40,40+K*30,Strin1);

                                           End;

                             Writeln;

                             K:=K+1;

                             u1:=u1+1;

                      End;

      K:=0;

      S:=S1+S2+S3+S4;

      S1:=0;

      S2:=0;

      S3:=0;

      S4:=0;

      u:=0;

      u1:=0;

      End;

      Procedure Summa4 (Var W:mass; Q:String);

      Begin

      If (m mod 2=0) Then True:=0 Else True:=1;

      u:=Trunc(n/2)+True;

      u1:=Trunc(m/2)+True;

      For i:=1 to u do

                     Begin

                           For j:=1 to u1 do

                                           Begin

                                                S1:=S1+W[i,j];

                                                Str(W[i,j],Strin1);

                                                OutTextXY (20+j*40,40+K*30,Strin1);

                                           End;

                             Writeln;

                             K:=K+1;

                      End;

      If True=1 Then S1:=S1-W[u,u];

      K:=0;

      u:=Trunc(n/2)+1;

      u1:=Trunc(m/2)+1;

      K:=u1-1;

      For i:=u to n do

                     Begin

                           For j:=u1 to m do

                                           Begin

                                                S2:=S2+W[i,j];

                                                Str(W[i,j],Strin1);

                                                OutTextXY (20+j*40,40+K*30,Strin1);

                                           End;

                             Writeln;

                             K:=K+1;

                      End;

      K:=0;

      S:=S1+S2;

      S1:=0;

      S2:=0;

      u:=0;

      u1:=0;

      End;

      BEGIN

           Randomize;

           P:GD:=Detect;

           InitGraph(GD,GM,'');

           M2:TekDeystvie:=1;

           ClearDevice;

           SetColor(3);

           OutTextXY (300,10,'MENU');

           SetColor(11);

           Line (295,19,335,19);

           Line (295,7,335,7);

           Line (295,19,295,7);

           Line (335,19,335,7);

           SetColor(2);

           SetFillStyle(1,2);

           FillEllipse(67,53,3,3);

           OutTextXY(74,50,'Vvod MASSIVA Vrychnyu');

           SetColor(15);

           OutTextXY(24,70,'Vvod MASSIVA SlychainbImi chislami');

           OutTextXY(74,90,'Sposob VbIchisleni9');

           OutTextXY(84,110,'VbIVod Rezultata');

           OutTextXY(600,470,'Exit');

      Repeat;

      Ch:=ReadKey;

      Case ch of

         {Knopka Enter}

      #13: Begin

                  Case TekDeystvie of

          1: Begin

                  SetColor (4);

                  OutTextXY(74,50,'Vvod MASSIVA Vrychnyu');

                  Delay (5000);

                  CloseGraph;

                  TextColor (11);

                  Write ('                         Vvedite kolichestvo strok ');

                  Readln (m);

                  If m<11 Then

                  Begin

                  Write ('                       Vvedite kolichestvo stolbcshov ');

                  Readln (n);

                  If n<11 Then

                  Begin

                  Writeln;

                  TextColor (6);

                  Vvodmass (A,'A');

                  TextColor (2);

                  Vyvodmass (A,'A');

                  Writeln;

                  TextColor (20);

                  K1:=1;

                  Write ('                                               Press ENTER to Continue');

                  Readln;

                  Goto P;

                  End

                  Else

                  Begin

                       TextColor(20);

                       Writeln;

                       Write('                   Chislo Stolbschov Dolzhno biT Menshe 11 ');

                       Readln;

                       Goto P;

                  End;

                End

                Else

                Begin

                     TextColor(20);

                     Writeln;

                     Write('                      Chislo Strok Dolzhno biT Menshe 11 ');

                     Readln;

                     Goto P;

                End;

             End;

          2: Begin

                  SetColor (4);

                  OutTextXY(24,70,'Vvod MASSIVA SlychainbImi chislami');

                  Delay (5000);

                  CloseGraph;

                  TextColor (11);

                  Write ('                         Vvedite kolichestvo strok ');

                  Readln (m);

                  If m<11 Then

                  Begin

                  Write ('                       Vvedite kolichestvo stolbcshov ');

                  Readln (n);

                  If n<11 Then

                  Begin

                  Writeln;

                  AutoVvodmass (A,'A');

                  TextColor (2);

                  Vyvodmass (A,'A');

                  Writeln;

                  TextColor (20);

                  K1:=1;

                  Write ('                                               Press ENTER to Continue');

                  Readln;

                  Goto P;

                  End

                  Else

                  Begin

                       TextColor(20);

                       Writeln;

                       Write('                   Chislo Stolbschov Dolzhno biT Menshe 11 ');

                       Readln;

                       Goto P;

                  End;

                End

                Else

                Begin

                     TextColor(20);

                     Writeln;

                     Write('                      Chislo Strok Dolzhno biT Menshe 11 ');

                     Readln;

                     Goto P;

                End;

             End;

          3: Begin

               M3:ClearDevice;

               If K1=1 Then

               Begin

               SetColor(3);

               OutTextXY (210,10,'Viberete Sposob Vichisleni9');

               SetColor(15);

               OutTextXY(600,470,'Back');

               SetColor(11);

               Line (205,19,430,19);

               Line (205,7,430,7);

               Line (205,19,205,7);

               Line (430,19,430,7);

               {1kvadrat}

               SetColor(10);

               Rectangle (30,60,150,210);

               SetFillStyle(1,9);

               Bar(33,63,147,207);

               SetColor(7);

               For i:=33 to 147 do

               Line(i,207,147,63);

               {2kvadrat}

               SetColor(1);

               Rectangle (260,60,380,210);

               SetFillStyle(1,9);

               Bar(263,63,377,207);

               SetColor(7);

               For i:=263 to 377 do

               Begin

                    Line(320,135,i,63);

                    Line(320,135,i,207);

               End;

               {3kvadrat}

               SetColor(1);

               Rectangle (490,60,610,210);

               SetFillStyle(1,9);

               Bar(493,63,607,207);

               SetColor(7);

               For i:=63 to 207 do

               Begin

                    Line(550,135,493,i);

                    Line(550,135,607,i);

               End;

               {4kvadrat}

               SetColor(1);

               Rectangle (30,290,150,440);

               SetFillStyle(1,9);

Информация о работе Информатика