Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- double a;
- double b;
- double c;
- double p;
- double s;
- cout << "a=";
- cin >> a;
- cout << "b=";
- cin >> b;
- cout << "c=";
- cin >> c;
- if (a+b<c){
- cout << "net takogo treugolnika" << endl;
- }
- if (a+c<b){
- cout << "net takogo treugolnika" << endl;
- }
- if (c+b<a){
- cout << "net takogo treugolnika" << endl;
- }
- p=(a+b+c)/2;
- cout << "p=";
- cout << p << endl;
- s=p*(p-a)*(p-b)*(p-c);
- s=sqrt(s);
- cout << "s=";
- cout << s << endl;
- }
Add Comment
Please, Sign In to add comment