其他分享
首页 > 其他分享> > a fortran example

a fortran example

作者:互联网

program volume_area
   real :: r,h,v,s,pi
   pi=3.1415926
   print *,'input radius r and height h?'
   read *,r,h
   v=r*r*h/3*pi
   s=pi*r*sqrt(r**2+h**2)+pi*r**2
   print *,'volume=',v
   print *,'area =',s

end

 

 

mikeli@mikeli-Latitude-E6440:~/code$ ./e_121_02
 input radius r and height h?
3.0 5.2
 volume=   49.0088425    
 area =   84.8544083

标签:area,height,volume,fortran,radius,print,pi,example
来源: https://www.cnblogs.com/lsjava/p/15364887.html