(1)的WRITE语句中的预期表达式 [英] Expected expression in WRITE statement at (1)
本文介绍了(1)的WRITE语句中的预期表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个简单的helloworld程序 !样本程序 程序主体 隐式无 整数i 实x
So it's a simple helloworld program !sample program program main implicit none integer i real x
write(6,*) ’Hello World!’
x=0
do i=1,10
x=x+i
if(mod(i,2).eq.0) then
write(6,*) i,x
else
if(x.lt.3) write(6,*) x,i
end if
end do
end
错误消失了
write(6,*) ’Hello World!’
1
Error: Expected expression in WRITE statement at (1)
推荐答案
这是因为您在Hello world
周围使用了弯引号.用直引号替换它们,它将起作用
It's because you're using curly quotes around Hello world
. Replace them with straight quotes and it'll work
因此替换
write(6,*) ’Hello World!’
与
write(6,*) 'Hello World!'
这篇关于(1)的WRITE语句中的预期表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文