fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. const double pi = 4.0 * atan(1.0);
  7.  
  8. double solve(double a, double b)
  9. {
  10. return pi * a * b / 2;
  11. }
  12.  
  13. int main()
  14. {
  15. double a, b;
  16. while (cin >> a >> b) {
  17. cout << solve(a, b) << endl;
  18. }
  19. }
  20.  
Success #stdin #stdout 0s 3432KB
stdin
31.0 2.0
28.0 5.0
stdout
97.3894
219.911