码迷,mamicode.com
首页 > 其他好文 > 详细

2020年4月21 日上机实习

时间:2020-04-21 15:09:36      阅读:44      评论:0      收藏:0      [点我收藏+]

标签:ram   ogr   end   ==   main   max   bsp   read   pre   

程序源码:

program main
implicit none
integer i,sum
real t(7),tmax
tmax=0.0;sum=0
do i=1,7
   read*,t(i)
   if(t(i)>=tmax) then
   tmax=t(i)
   end if
   if(t(i)>20) then
   sum=sum+1
   end if
end do 
print*,‘日最高气温的最大值为:‘
print*,‘tmax=‘,tmax
print*,‘日最高气温所在的日期为:‘
do i=1,7
    if(t(i)==tmax) write(*,"(1X,‘三月‘,I2,‘日‘)") i+22
end do
print *,‘气温大于20℃的天数为:‘
print *,‘sum=‘,sum
end

 

2020年4月21 日上机实习

标签:ram   ogr   end   ==   main   max   bsp   read   pre   

原文地址:https://www.cnblogs.com/lxl720/p/12744445.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!