我是Fortran的新手,我不明白这一行:
write(*,'(a35)', advance='no')
在:
program democonvertion
implicit none
real :: tc, tf, tr, tk
write(*,'(a35)', advance='no')
& "Enter the temperature in Celcius: "
read(*,*) tc
tf = (9./5) * tc + 32
tr = (4./5) * tc
tk = tc + 273
write(*,*)
write(*,'(4a11)') "Celcius","Farenheit","Reamur","Kelvin"
write(*,'(4f11.2)') tc, tf, tr, tk
end program democonvertion
我已经编译了这段代码,但它确实有效。但我还是不明白。
答案 0 :(得分:4)
advance='no'
表示在完成撰写后write
语句不会前进到下一条记录(下一行)。
参见Supressing line breaks in Fortran 95 write statements 和其他相关的问题和答案。