/programy/pascal/zaklady/FAKTORIA |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/pascal/zaklady/FAKTORIA.PAS |
---|
0,0 → 1,33 |
program ahoj; |
uses crt; |
var |
x,fact: double; |
begin |
clrscr; |
write ('Yadejte cele cislo: '); |
readln(x); |
fact:=1; |
if(x>=0) then |
begin |
while ((x>1)) do |
begin |
fact := fact * x; |
x := x - 1; |
end; |
writeln ('faktorial cisla je:', fact:10:0); |
end |
else |
begin |
writeln('Faktorial zaporneo cisla neni definovan'); |
end; |
readkey; |
end. |
/programy/pascal/zaklady/MOJEUNIT.PAS |
---|
0,0 → 1,13 |
unit MojeUnit; |
interface |
function mojefunkce (x,y: integer) : integer |
implementation |
function mojefunkce(x,y :integer) :integer |
begin |
mojefunkce := x+y; |
end; |
end. |
/programy/pascal/zaklady/ROVNICE.PAS |
---|
0,0 → 1,62 |
program druhy; |
{$N+} |
uses crt; |
var |
a,b,c : integer; |
koren1,koren2 : double; |
type |
koreny = record |
x1 : double; |
x2 : double; |
end; |
procedure vyres(a,b,c: integer; var x1,x2 : double); |
var |
diskr : double; |
begin |
diskr:= b*b -4 * a * c; |
if (diskr < 0) then |
begin |
writeln ('Rovnice nema realne reseni'); |
exit; |
end; |
if(diskr = 0) then |
begin |
x1:= -b/2*a; |
writeln('rovnice ma jeden koren : ', x1) |
end |
else begin |
x1:= (-b+sqrt(diskr))/2; |
x2:= (-b-sqrt(diskr))/2; |
writeln('Rovnice ma dva koreny ',x1,' ',x2) |
end; |
end; |
begin |
clrscr; |
writeln ('zadejte tri koreny rovnice:'); |
readln(a); |
readln(b); |
readln(c); |
vyres(a,b,c, koren1, koren2); |
readln; |
end. |
/programy/pascal/zaklady/SUMA_KAK |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/pascal/zaklady/SUMA_KAK.PAS |
---|
0,0 → 1,34 |
program suma; |
uses crt; |
var n : integer; |
function secti(n:integer) : integer; |
var i,sum : integer; |
begin |
sum :=0; |
for i:=1 to n do |
begin |
sum:= sum + i; |
end; |
secti :=sum; |
end; |
begin |
clrscr; |
write ('zadejte hodnotu'); |
readln (n); |
write('vysledek je',secti(n)); |
readln; |
end. |
/programy/pascal/zaklady/UNITA.PAS |
---|
0,0 → 1,62 |
program druhy; |
{$N+} |
uses crt,mojeunit; |
var |
a,b,c : integer; |
koren1,koren2 : double; |
type |
koreny = record |
x1 : double; |
x2 : double; |
end; |
{procedure vyres(a,b,c: integer; var x1,x2 : double); |
var |
diskr : double; |
begin |
diskr:= b*b -4 * a * c; |
if (diskr < 0) then |
begin |
writeln ('Rovnice nema realne reseni'); |
exit; |
end; |
if(diskr = 0) then |
begin |
x1:= -b/2*a; |
writeln('rovnice ma jeden koren : ', x1) |
end |
else begin |
x1:= (-b+sqrt(diskr))/2; |
x2:= (-b-sqrt(diskr))/2; |
writeln('Rovnice ma dva koreny ',x1,' ',x2) |
end; |
end;} |
begin |
clrscr; |
{ writeln ('zadejte tri koreny rovnice:'); |
readln(a); |
readln(b); |
readln(c); |
vyres(a,b,c, koren1, koren2); |
} readln; |
end. |
/programy/pascal/zaklady/pole.PAS |
---|
0,0 → 1,9 |
program poleprg; |
var |
pole : array |
begin |
end. |
/programy/pascal/zaklady/ruzne.pas |
---|
0,0 → 1,109 |
program zamena; |
uses crt; |
var x,y : integer; |
procedure swap(var x,y : integer); |
var buf, buf2: integer; |
begin |
buf:=x; |
x:=y; |
y:=buf; |
end; |
function mocnina(R:double; E : integer ): double; |
var i : integer; |
var nasobek : double; |
begin |
if E > 0 then |
begin |
nasobek:=1; |
for i:=1 to E do |
begin |
nasobek:=R*nasobek; |
end; |
mocnina:=nasobek; |
end; |
if E < 0 then |
begin |
nasobek:=1; |
for i:=1 to abs(E) do |
begin |
nasobek:=(1/R)*nasobek; |
end; |
mocnina:=nasobek; |
end; |
if E=0 then mocnina:=1; |
end; |
procedure kruh(): double |
var x,y: integer; |
begin |
for 0 to 1000000 do |
begin |
x:=random(0,1000); |
y:=random(0,1000); |
if sqrt(x pow(2) + y pow(2)) <= 1000; then n:= n+1; |
kruh |
end |
end; |
begin |
clrscr; |
randomized; |
x:=1; |
y:=2; |
write('zadejte hodnoty zaklad, exponent'); |
readln(x); |
readln(y); |
write('x na y je:', mocnina(x,y)); |
readln; |
swap(x,y); |
end. |
/programy/pascal/zaklady/stringy.pas |
---|
0,0 → 1,42 |
program poleprg; |
uses crt; |
const |
size = 5; |
var |
i,k, max, min, sum :integer; |
pole : array [1..size] of integer; |
matice1 : array [1..size,1..size] of integer; |
matice2 : array [1..size,1..size] of integer; |
matice3 : array [1..size,1..size] of integer; |
prumer : real; |
ch : char; |
s : string; |
begin |
randomize; |
clrscr; |
writeln(Succ('a')); |
writeln(Pred('a')); |
writeln(Ord('a')); |
writeln(Chr(100)); |
writeln(length(s)); |
readln(s); |
for i:=length(s) downto 1 do write('',s[i]); |
readln; |
end. |