Advertisement
Pretoript

triangle

Jan 27th, 2021 (edited)
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.        
  6.     float a,b,c;
  7.    
  8.     std::cout << "Please give the a value: ";
  9.     std::cin>>a;
  10.    
  11.     std::cout << "Please give the b value: ";
  12.     std::cin>>b;
  13.    
  14.     std::cout << "Please give the b value: ";
  15.     std::cin>>c;
  16.    
  17.     if(a < b+c && b < a+c && c < a+b)
  18.     {
  19.         std::cout << "Triangle can be constructed.";
  20.     }
  21.     else
  22.     {
  23.         std::cout << "Triangle can NOT be constructed.";
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement