fork(1) download
  1.  
  2. #include<iostream>
  3. #include<math.h>
  4. #include<iomanip>
  5.  
  6. using namespace std;
  7.  
  8. int r;
  9. int d;
  10. double wynik;
  11.  
  12. int main()
  13. {
  14. const double Pi= 3.141592654;
  15.  
  16. while(cin >> r >> d)
  17. {
  18. wynik = (pow(r, 2) - pow(d, 2) / 4)*Pi;
  19.  
  20. cout << fixed << setprecision(2) << wynik << endl;
  21. }
  22.  
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 4380KB
stdin
10 10 
1000 1500
2000 2000
0 10
10 0
11 12
stdout
235.62
1374446.79
9424777.96
-78.54
314.16
267.04