Advertisement
Guest User

Program Mateusz

a guest
Oct 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. int najwieksza_liczba()
  7. {
  8. int a,b,c;
  9. cout<<"Podaj 1 liczbe:";
  10. cin>>a;
  11. cout<<"Podaj 2 liczbe:";
  12. cin>>b;
  13. cout<<"Podaj 3 liczbe:";
  14. cin>>c;
  15.  
  16. if((a>b) && (a>c))
  17. {
  18. return a;
  19. }
  20. else if((a<b) && (b>c))
  21. {
  22. return b;
  23. }
  24. else
  25. {
  26. return c;
  27. }
  28.  
  29. cin.ignore();
  30. getchar();
  31. return 0;
  32. }
  33.  
  34. int pole_trojkata()
  35. {
  36. int pole = najwieksza_liczba()*sqrt(3)/4;
  37. return pole;
  38.  
  39. }
  40. int main()
  41. {
  42. cout<<"Najwieksza liczba to:" <<najwieksza_liczba();
  43. cout<<"Pole trojkata wynosi:" <<pole_trojkata();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement