Difference between revisions of "Cppreference:Archives"
From cppreference.com
Line 1: | Line 1: | ||
− | + | #include <iostream> | |
− | + | #include <math.h> | |
− | + | ||
− | #include<iostream> | + | |
− | #include< | + | |
− | + | ||
using namespace std; | using namespace std; | ||
− | int | + | int main() |
− | + | { | |
− | + | float l1, l2, l3, p, P, A; | |
− | + | cout<<"l1="; | |
− | + | cin>>l1; | |
− | + | cout<<"l2="; | |
− | + | cin>>l2; | |
− | + | cout<<"l3="; | |
− | + | cin>>l3; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | P=l1+l2+l3; | |
− | + | cout<<"Perimetrul triunghiului oarecare este: "<<P; | |
− | + | p=(l1+l2+l3)/2; | |
− | + | cout<<"\n"<<"Semiperimetrul triunghiului oarecare este: "<<p; | |
− | + | A=sqrt((p)*(p-l1)*(p-l2)*(p-l3)); | |
− | + | cout<<"\n"<<"Aria triunghiului oarecare este: "<<A; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } |
Revision as of 03:58, 16 January 2020
- include <iostream>
- include <math.h>
using namespace std;
int main() { float l1, l2, l3, p, P, A; cout<<"l1="; cin>>l1; cout<<"l2="; cin>>l2; cout<<"l3="; cin>>l3;
P=l1+l2+l3; cout<<"Perimetrul triunghiului oarecare este: "<<P; p=(l1+l2+l3)/2; cout<<"\n"<<"Semiperimetrul triunghiului oarecare este: "<<p; A=sqrt((p)*(p-l1)*(p-l2)*(p-l3)); cout<<"\n"<<"Aria triunghiului oarecare este: "<<A; }