Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. //12.2
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6. double s(double a,double b,double c){
  7. double p;
  8. p=(a+b+c)/2.0;
  9. return (sqrt(p*(p-a)*(p-b)*(p-c)));
  10. }
  11. double s(double r){
  12. return (r*r*M_PI);
  13. }
  14.  
  15. int main()
  16. {
  17. double a,b,c,r;
  18. cin>> a>>b>>c>>r;
  19. cout <<s(a,b,c)<<"\t"<<s(r);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement