background image

/*    Sylwia Seweryn 
 

Grupa E3Q2S1 

 

08.04.2014r. 

 

Program własny - pole i obwód trójkąta. 

*/ 

#include<stdio.h> 
#include<iostream> 
#include<conio.h> 
#include<math.h> 

using namespace

 std; 

10 

void

 fTytul(); 

float

 fDlugosc_boku(

float

 a); 

float

 fObwod(

float

 x); 

float

 fKwadrat(

float

 x); 

float

 fPole(

float

 x); 

15 

int

 main() 


 

system(

"title Pole i obwód trójkąta"

); 

 

float

 a; 

 

fTytul(); 

20 

a= fDlugosc_boku; 

 

float 

Obwod=fObwod(a); 

 

float

 Pole=fPole(a); 

 

gotoxy(

10

,

15

); 

 

cprintf(

"Obwod trojkata: %6.4f"

,Obwod); 

25 

 

gotoxy(

10

,

16

); 

 

cprintf(

"Pole trojkata: %6.4f"

,Pole); 

 

getchar(); 

 

return

 

0

30 

void

 fTytul() 

gotoxy(

10

,

10

); 

 

textcolor(

2

); 

 

cprintf(

"Pole i obwod trojkata rownobocznego"

); 

35 

 

gotoxy(

10

,

11

); 

 

cprintf(

"===================================="

); 

float

 fDlugosc_boku(

float

 a) 

40 

 

textcolor(

5

); 

 

gotoxy(

10

,

13

); 

 

cprintf(

"Podaj dlugosc bokow a="

); 

 

cscanf(

"%f"

,&a); 

 

return

 a; 

45 

float

 fObwod(

float

 x) 


 

return

 

3

*x; 

50 

float

 fKwadrat(

float

 x) 

return

 x*x; 

float

 fPole(

float

 x) 

55 

return

 fKwadrat(x)*

1.73/4