fork download
  1. #include <stdio.h>
  2.  
  3. #define PI 3.14159265358979323846
  4.  
  5. double delta_cone(double r, double h) {
  6. return (1.0 / 3.0) * PI * r * r * h;
  7. }
  8.  
  9. int main() {
  10. double radius, height;
  11.  
  12. printf("r");
  13. scanf("%lf", &radius);
  14. printf("h");
  15. scanf("%lf", &height);
  16.  
  17. double volume = delta_cone(radius, height);
  18.  
  19. printf("円錐の体積: %.2f\n", volume);
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
rh円錐の体積: 0.00