Äàíà òàáëèöà f ñîäåðæàùàÿ ñâåäåíèÿ î âåùåñòâàõ:

Óêàçûâàåòñÿ íàçâàíèå âåùåñòâà, åãî óäåëüíûé âåñ è ïðîâîäèìîñòü.

Ïðîãðàììà íàõîäèò óäåëüíûé âåñ è íàçâàíèÿ âñåõ ïîëóïðîâîäíèêîâ.

 

Uses CRT;

 

Const Veshestvo = 1;

 

Type Material = Record

                Name: String[20];

                Weight: Real;

                Provod: Integer;

                                 {0 - èçîëÿòîð }

                                 {1 - ïîëóïðîâîäíèê}

                                 {2 - ïðîâîäíèê}

           End;

 

Var Result,I,J,N: Integer;

    F : Array[1..20] Of Material;

 

   

Begin

 

F[1].name := 'Ìåäü';           F[1].Weight := 4.00; F[1].Provod := 2;

F[2].name := 'Áóìàãà';         F[2].Weight := 66.0; F[2].Provod := 0;

F[3].name := 'Êðåìíèé';        F[3].Weight := 5.40; F[3].Provod := 1;

F[4].name := 'Ãåðìàíèé';       F[4].Weight := 21.5; F[4].Provod := 1;

F[5].name := 'Àðñåíèä';           F[5].Weight := 3.00; F[5].Provod := 1;

F[6].name := 'Àëþìèíèé';       F[6].Weight := 50.0; F[6].Provod := 2;

F[7].name := 'Êåðàìèêà';       F[7].Weight := 9.90; F[7].Provod := 0;

F[8].name := 'Ðåçèíà';             F[8].Weight := 80.0; F[8].Provod := 0;

F[9].name := 'Ôòîðîïëàñò';     F[9].Weight := 4.00; F[9].Provod := 0;

 

       ClrScr;

       N := 9;

       Result := 0;

 

       Writeln('Íàèìåíîâàíèå ìàòåðèàëà        Óäåëüíûé âåñ       Ïðîâîäèìîñòü');

       Writeln('-----------------------------------------------------------');

       For I := 1 to N Do

           If (F[I].Provod = Veshestvo) Then Begin

              Write(F[I].Name:22,F[I].Weight:15:2);

 

              Case F[I].Provod Of

              0: WriteLn('Èçîëÿòîð':15);

              1: WriteLn('Ïîëóïðîâîäíèê':15);

              2: WriteLn('Ïðîâîäíèê':15);

              End;

 

              Result := Result + 1;

           End;

       Writeln('-----------------------------------------------------------');

       Writeln('Íàéäåíî ',Result,' ìàòåð.');

 

       If Result = 0 Then WriteLn('Òàêîãî ìàòåðèàëà íåò');

       Readln;

End.