fork(1) download
  1. #include <cmath>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main() {
  6. double a, b, c, S, P;
  7. cout<<"a = ";cin>>a;
  8. cout<<"b = ";cin>>b;
  9. S = 0.5*a*b;
  10. c = sqrt(a*a + b*b);
  11. P = a + b + c;
  12. cout<<endl<<"RESULTS:"<<endl;
  13. cout<<"S = "<<S<<endl;
  14. cout<<"P = "<<P<<endl;
  15. cin.get();
  16. return 0;
  17. }
Success #stdin #stdout 0s 3476KB
stdin
5
6
stdout
a = b = 
RESULTS:
S = 15
P = 18.8102