防空警报3分钟:fortran和c的问题

来源:百度文库 编辑:高校问答 时间:2024/05/06 12:54:12
read(1,*)(k,cv30(i),i=1,ms7)

format(2x,'The total No.of nodes of forth aquitard Nq4=',I4)write (2,23)MA1

dimension A1(2000,2000),A2(2000,2000),A3(2000,2000),A4(2000,2000),ht(2000),H1(2000),H2(2000),H3(2000),H4(2000),&
&B1(2000),B2(2000),B3(2000),B4(2000)
open (unit=6,file='subm.l4')
这几段程序用c怎么解释阿? 谢谢

写成C:

(1) read(1,*)(k,cv30(i),i=1,ms7)
从1号文件,用自由格式读入整数k,和数组cv30.

int k,ms7;
float cv30[ms7];
int i;
fscanf(fin1,"%d",&k);
for (i=0;i<ms7;i++) fscanf(fin1,"%f",&cv30[i]);

(2)write (2,23)MA1
23 format(2x,'The total No.of nodes of forth aquitard Nq4=',I4)

int mai;
fprintf(fout2," The total No.of nodes of forth aquitard Nq4=%4d\n",mai);

(3) dimension A1(2000,2000) .....
float a1[2000][2000]....h4[2000],b1[2000]....;

(4) open (unit=6,file='subm.l4')

FILE *fin6;
fin6 = fopen("subm.l4","r"); // 作为输入文件打开

fin6 = fopen("subm.l4","w"); // 作为输出文件打开