fortran和c的问题
发布网友
发布时间:2022-07-14 17:10
我来回答
共1个回答
热心网友
时间:2023-10-01 18:25
写成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"); // 作为输出文件打开