fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a, b, c, p, S;
  9. cin>>a >> b >> c;
  10. p=(a+b+c)/2;
  11. cout<<p;
  12. S=sqrt((p*(p-a)*(p-b)*(p-c)));
  13. cout<<"S=";
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5420KB
stdin
5 7 8 
stdout
10S=