6.4.. Učitati stranice trougla i naći obim i površinu.
Opis rješenja:
Opis programa:
Za objaĆĄnjenje:
*** |
Listing programa |
Opis |
1 |
PROGRAM P06411083; |
|
2 |
USES |
|
3 |
WinCRT; |
|
4 |
VAR |
|
5 |
a,b,c,o: INTEGER; |
|
6 |
p,s: REAL; |
|
7 |
BEGIN |
|
8 |
WRITE(' Unesi stranice trougla a,b,c :'); |
|
9 |
READLN(a,b,c); |
Ulaz |
10 |
o:=a+b+c; |
Obrada |
11 |
s:=o/2; |
|
12 |
p:=sqrt(s*(s-a)*(s-b)*(s-c)); |
|
13 |
WRITELN('O=',o,' P=',p:4:2); |
Izlaz |
14 |
END. |
|
Listing programa:
PROGRAM P06411083;
VAR
a,b,c,o: INTEGER;
p,s: REAL;
BEGIN
WRITE(' Unesi stranice trougla a,b,c :');
READLN(a,b,c);
o:=a+b+c;
s:=o/2;
p:=sqrt(s*(s-a)*(s-b)*(s-c));
WRITELN('O=',o,' P=',p:4:2);
READLN;
END.
Ispis na ekranu:
Index
|
|