.


:




:

































 

 

 

 





̳ ,

 

 

 

:

 

 

1-2

:

2- _____________________________

 

 

_________________ ______________

() (ϳ )

 

 

__________________

 

______________

()

________________ /_____________________/

(ϳ) ( )

 

 

2012 .

1

:

: , , ; (Pascal, C) .

1. , a,b,c .

:

-

 

   
 
 
 

 


+ -

       
   
 


+ -

           
     
 
 
 


+ -

           
   
     
 
 
 


 

 
 


+ -

       
   
 


 

           
     
 
 
 

 


+ -

       
   


 

 

               
   
   
   
 
 
 

 


 
 


˳ (Pascal)

Program rivnannya;

uses crt;

var a,b,c,D,x,x1,x2:real;

Begin

clrscr;

writeln('Znahodzhennya koreniv kvadratnogo r-nnya');

writeln('Vvedit koefisienty r-nnya');

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

if (a=0) and (b=0) and (c=0)

Then

writeln('R-nnya mae bezlich koreniv')

Else

Begin

if (a=0) and (b=0) and (c<>0)

Then

writeln ('Koreniv nenae')

Else

Begin

if (a=0) and (b<>0) and (c<>0)

Then

Begin

x:=-c/b;

writeln('x=',x:6:2);

End

Else

Begin

if (a=0) and (b<>0) and (c=0) or (a<>0) and (b=0) and (c=0)

Then

writeln('x=0')

Else

Begin

D:=sqr(b)-4*a*c;

if D>=0

Then

Begin

x1:=(-b+sqrt(D))/2*a;

x2:=(-b-sqrt(D))/2*a;

writeln('x1=',x1:6:2,'x2=',x2:6:2);

End

Else

writeln('Diysnuh koreniv nemae');

end;

end;

end;

end;

readkey;

end.

 

.1

 

 

.2

 

2. a,b,c. , a,b,c , .

:

-

 
 


 
 


+ -

       
   
 


 
 


       
   
 
 


 
 


˳ (Pascal)

Program heron;

uses crt;

var a,b,c,p,S: real;

Begin

clrscr;

writeln('Isnyvannya trikytnika');

writeln('Vvestu dovzhiny storin');

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

if (a+b>c) and (a+c>b) and (b+c>a)

Then

Begin

p:=(a+b+c)/2;

S:=sqrt(p*(p-a)*(p-b)*(p-c));

writeln('Trikutnuk isnue i mae ploschy S=',S:6:2);

End

Else

writeln('Trikutnuk ne isnye');

readkey;

end.

.3

 

3. a,b. .

:

-

 
 

 
 


+ -

       
   


           
     
 
 


 
 


˳ (Pascal)

program evklid;

uses crt;

var a, b:integer;

function nsd(x, y: integer):integer;

Begin

if x<>0 then nsd:=nsd(y mod x, x)

else nsd:=y;

end;

Begin

writeln('Vvedit chisla a i b: ');

write('a = '); readln(a);

write('b = '); readln(b);

writeln('NSD chisel ', a, ' i ', b, ' = ', nsd(a, b));

readkey;

end.

 

.4

4. , , 23 .

:

-

 
 


 
 


+ -

       
   
 


 
 


+

+

 
 


 
 


       
   
 
 


˳ (Pascal)

program d23;

uses crt;

var i,k: integer;

Begin

clrscr;

i:= 989;

k:=0;

writeln('Dilyatsia na 23:');

Repeat





:


: 2017-01-28; !; : 280 |


:

:

, , .
==> ...

1716 - | 1618 -


© 2015-2024 lektsii.org - -

: 0.068 .