Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 62 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     double a, b, c, S, s;
  10.     cout << "Zadejte delky stran trojuhelnika a, b, c:" << endl;
  11.     cin >> a >> b >> c;
  12.     if((a > 0) && (b > 0) && (c > 0)){
  13.     s = (a + b + c)/2;
  14.     S = sqrt(s * (s - a) * (s - b) * (s - c));
  15.     if (S > 0)
  16.         cout << "Obsah trojuhelnika je " << S << endl;
  17.     else
  18.         cout << "Nejedna se o platny trojuhelnik." << endl;
  19.         }
  20.         else
  21.         cout << "Nejedna se o platny trojuhelnik."
  22.  
  23.  
  24.     return 0;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top