Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <math.h>
- using namespace std;
- int najwieksza_liczba()
- {
- int a,b,c;
- cout<<"Podaj 1 liczbe:";
- cin>>a;
- cout<<"Podaj 2 liczbe:";
- cin>>b;
- cout<<"Podaj 3 liczbe:";
- cin>>c;
- if((a>b) && (a>c))
- {
- return a;
- }
- else if((a<b) && (b>c))
- {
- return b;
- }
- else
- {
- return c;
- }
- cin.ignore();
- getchar();
- return 0;
- }
- int pole_trojkata()
- {
- int pole = najwieksza_liczba()*sqrt(3)/4;
- return pole;
- }
- int main()
- {
- cout<<"Najwieksza liczba to:" <<najwieksza_liczba();
- cout<<"Pole trojkata wynosi:" <<pole_trojkata();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement