| 
 
	积分3256贡献 精华在线时间 小时注册时间2013-11-29最后登录1970-1-1 
 | 
 
| 
如题,fortran中如果把字符型的变量赋值成汉字,这样在fortran77里可以吗?为什么最后程序的结果   t(1)---t(5)是0呢?
x
登录后查看更多精彩内容~您需要 登录 才可以下载或查看,没有帐号?立即注册 
  
 characte names(5)*30
 character start*150,title(5)*30
 
 integer t(5)
 
 names(1) ='区站号/马士顿号'
 names(2) ='年'
 names(3) ='月'
 names(4) ='日'
 names(5) ='时次'
 
 open(1,file='20110720220529_SURF_WEA_GLB_MUL_FTM_QC.txt',status='unknown')
 
 
 read(1,100) start(1:150)
 
 
 do 11 i=1,5
 title(i)=start(30*(i-1)+1:30*i)
 print*,title(i)
 
 
 if(trim(adjustl(adjustr(title(i)))).eq.trim(adjustl(adjustr(names(1)))))then
 t(1)=i
 endif
 if(trim(adjustl(adjustr(title(i)))).eq.trim(adjustl(adjustr(names(2)))))then
 t(2)=i
 endif
 if(trim(adjustl(adjustr(title(i)))).eq.trim(adjustl(adjustr(names(3)))))then
 t(3)=i
 endif
 if(trim(adjustl(adjustr(title(i)))).eq.trim(adjustl(adjustr(names(4)))))then
 t(4)=i
 endif
 if(trim(adjustl(adjustr(title(i)))).eq.trim(adjustl(adjustr(names(5)))))then
 t(5)=i
 endif
 print*,t(i)
 11    continue
 
 end
 
 
 | 
 |