Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip> //for setprecision()
- #include<cmath> //for pow()
- using namespace std;
- int main()
- {
- double pi = 3.14159, a, b, c;
- cin >> a;
- cin >> b;
- cin >> c;
- double area_of_triangle = 0.5 * a * c;
- double area_of_circle = pi * pow(c, 2);
- double area_of_trapezium = ((a+b) * c)/2;
- double area_of_square = pow(b, 2);
- double area_of_rectangle = a*b;
- cout << "TRIANGULO: " << fixed << setprecision(3) << area_of_triangle << endl;
- cout << "CIRCULO: " << fixed << setprecision(3) << area_of_circle << endl;
- cout << "TRAPEZIO: " << fixed << setprecision(3) << area_of_trapezium << endl;
- cout << "QUADRADO: " << fixed << setprecision(3) << area_of_square << endl;
- cout << "RETANGULO: " << fixed << setprecision(3) << area_of_rectangle << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement