Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main(int argc, const char * argv[]) {
- double a, p, result;
- cout << "Input area of square: " << endl;
- cin >> a;
- result = 4 * sqrt(a);
- cout << "P = " << result << endl;
- cout << "Input P of triangle: ";
- cin >> p;
- double triangle_a = p/3;
- double s_triangle = pow(triangle_a, 2) * sqrt(3)/4;
- cout << "S of triangle = " << s_triangle << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement