fork download
  1. #include <stdio.h>
  2.  
  3. double PI=3.14;
  4.  
  5. double circum_length(double r)
  6. {
  7. return 2*r*PI;
  8. }
  9.  
  10. double area(double r)
  11. {
  12. return r*r*PI;
  13. }
  14.  
  15. int main(void) {
  16.  
  17. double r;
  18. scanf("%lf",&r);
  19. printf("円周:%lf,面積:%lf",circum_length(r),area(r));
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 5280KB
stdin
3
stdout
円周:18.840000,面積:28.260000