Предмет: Информатика, автор: ovoi

Помогите по информатике срочно пожалуйста!Даю 35 баллов!

Приложения:

Ответы

Автор ответа: ForeignAgent
1

Ответ:

Объяснение:

N2

program ZotXY;

const

   e = 2.7182818284;

var

   x, y, z : real;

begin

   write ('input x, y ');

   read (x, y);

   if sqrt(x)+y > 10 then z := sin(4*x*y);

   if sqrt(x)+y < 10 then z := 2*y-x;

   if sqrt(x)+y = 10 then z := x-e;

   Writeln ('sqrt(x)+y = ', sqrt(x)+y:10:5);

   Writeln ('z = ', z:10:5);

end.

Compiling main.pas

Linking a.out                     

19 lines compiled, 0.1 sec

input x, y 16

6                                   

sqrt(x)+y =   10.00000            

z =   13.28172

Compiling main.pas              

Linking a.out                   

19 lines compiled, 0.2 sec

input x, y 20                   

30                                

sqrt(x)+y =   34.47214          

z =   -0.17587

Compiling main.pas              

Linking a.out                   

19 lines compiled, 0.1 sec      

input x, y 3                    

4                                 

sqrt(x)+y =    5.73205          

z =    5.00000

N3

program FckngArray;

const

   b = -6;

var

   x : array [1..20] of real;

   pr  : real;

   i, qty : integer;

begin

   pr := 1; qty := 0;

   for i := 1 to 20 do begin write ('input x[',i,'] '); readln(x[i]); end;

   for i := 1 to 20 do  

       if (x[i] <> 0) and (x[i] > b) then

           begin

               pr := pr * x[i];

               qty := qty +1;

           end;

   Writeln ('Pr = ', pr:10:5, ' Qty = ',qty);

end.

Compiling main.pas              

Linking a.out                   

23 lines compiled, 0.2 sec

input x[1] 0.3

input x[2] 5

input x[3] 69

input x[4] -3

input x[5] 52

input x[6] -20                          

input x[7] -9                     

input x[8] -23                    

input x[9] -9                    

input x[10] 10              

input x[11] 36                  

input x[12] 12                    

input x[13] 15                  

input x[14] 23                    

input x[15] -0.2                

input x[16] -36                 

input x[17] -0.3                  

input x[18] 8                     

input x[19] 45                  

input x[20] -7                  

Pr = -519782365440.00000 Qty = 14        

N4 в задании какая то хрень. если перебирать сторону от 0 до 15 будет 6 квадратов, а не 5. а при стороне 0 квадрат вообще не существует

program space;

var

   i : integer;

begin

   for i := 1 to 5 do writeln ('By a = ',i*3,' space = ',sqr(i*3));

end.

Compiling main.pas              

Linking a.out

9 lines compiled, 0.2 sec

By a = 3 space = 9              

By a = 6 space = 36              

By a = 9 space = 81               

By a = 12 space = 144            

By a = 15 space = 225

Похожие вопросы