Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main(int argc, const char * argv[]) {
  5. double a, p, result;
  6. cout << "Input area of square: " << endl;
  7. cin >> a;
  8. result = 4 * sqrt(a);
  9. cout << "P = " << result << endl;
  10.  
  11. cout << "Input P of triangle: ";
  12. cin >> p;
  13.  
  14. double triangle_a = p/3;
  15. double s_triangle = pow(triangle_a, 2) * sqrt(3)/4;
  16.  
  17. cout << "S of triangle = " << s_triangle << endl;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement