面试题答案
一键面试program high_temperature
implicit none
integer :: temperature(7) = [28, 32, 29, 35, 27, 31, 33]
integer :: i, count_high = 0
do i = 1, 7
if (temperature(i) > 30) then
print *, '第', i, '天的气温为', temperature(i), '度,高于30度'
count_high = count_high + 1
end if
end do
print *, '一周内高温天数为:', count_high
end program high_temperature