fork download
  1. #include <iostream>
  2. #include<cmath>
  3. #include<iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. const double PI = 3.141592654;
  10. double d,r;
  11. cin>>d>>r;
  12.  
  13. std::cout.precision(2);
  14. std::cout << std::fixed << std::showpoint << PI*(r*r-0.25*d*d);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 4240KB
stdin
1000 1500
stdout
6283185.31