有以下程序,其功能是:以二进制"写"方式打开文件d1.dat,写入l-100这100个整数后关闭文件。再以二进制"读"方式打开文件d1.dat,将这100个整数读入到另一个数组b中,并打印输出。请填空。 #include main() {FILE *fp; int i,a[100],b[100]; fp=fopen("d1.dat","wb"); for(i=O;i<100;i++), a[i]=i+1; fwrite(a,sizeof(int),100,fp); fclose(fp); fp=fopen("d1.dat",【 】); fread(b ,sizeof(int),100,fp); fclose(fp); for(i=0;i<100;i++)prinff("%d\n",b[i]); }
查看答案
Trade relationships between the two countries will improve if their()leaders could agree on the proposed quotas.
A. respectable
B. respective
C. respectful
D. respecting
以下程序企图把从终端输入的字符输出到名为abc.txt的文件中,直到从终端读入字符#号时结束输入和输出操作,但程序有错。 #include <stdio.h> main( ) { FILE *fout; char ch; fout=fopen(’’abc.txt’’,’’w’’); ch=fgetc(stdin); while(ch!=’’#’’) { fputc(ch,fout); ch =fgetc(stdin); } fclose(fout); } 出错的原因是( )。
A. 函数fopen调用形式有误
B. 输入文件没有关闭
C. 函数fgetc调用形式有误
D. 文件指针stdin没有定义
以下程序运行后的输出结果是【 】 int a=5; fun(int b) { static int a=10; a+=b++; printf("%d ",a); } main( ) { int c=20; fun(c); a+=c++; printf("%d\n",a); }
Any earthquake that takes place in any area is certainly regarded as a kind of a ______ event.
A. cholesterol
B. charcoal
C. catastrophic
D. chronic