fork download
  1. #include <stdio.h>
  2.  
  3. struct Ellipse{
  4. double a;
  5. double b;
  6. };
  7.  
  8. int main(void) {
  9. struct Ellipse data;
  10. double area;
  11. double pi=3.14;
  12.  
  13. data.a=5.0;
  14. data.b=3.0;
  15.  
  16. area=pi*data.a*data.b;
  17.  
  18. printf("長径:%.2f,短径:%.2fの楕円の面積は%.2fです",
  19. data.a,data.b,area);
  20.  
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
長径:5.00,短径:3.00の楕円の面積は47.10です