作者Ascene (Ascene)
看板Fortran
标题[问题] 请问character 的问题
时间Sun Dec 27 04:14:03 2009
as title
character machine
read(*,*) machine
想请问说有没有办法在 IF 条件设定下
设定如果 我键盘输入machine 为 auto 这串字
那他就列印出 auto
如果我键盘输入 machine 为 manual
则列印出 manual 这样的逻辑运算
如果不是输入 auto 或是 manual 就显示说错误.
我写的程式是这样:
program test
implicit none
character machine
IF(machine == "auto") then ..... <= 这里我觉得应该是写错
不过不知道要怎麽改来判断我是不是输入 auto 或 manual 这字串
希望有高手可以帮我, 谢谢 orz 小弟在此先行道谢 ^.^
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.109.113.27
1F:推 laa7352:character machine*10 12/27 08:53
2F:→ laa7352: ^^^没设*10的话 变数只会存第一个英文字 12/27 08:55
3F:→ Ascene:谢谢, 了解 orz 感谢楼上的强者 ^.^ 12/27 19:52