Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- float area(int x);
- int main() {
- setlocale(LC_ALL, "Rus");
- int n;
- cout << "Введите длину ребра: ";
- cin >> n;
- cout << "Площадь полной поверхности пирамиды равна: " << area(n);
- }
- float area(int x) {
- double So, Sb, S, h, P;
- So = (5 * pow(x, 2)) / (4 * tan(180 / 5));
- P = 5 * x;
- h = (x * sqrt(3)) / 2;
- Sb = (P + h) / 2;
- S = So + Sb;
- return S;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement