填空题

下面的程序把从终端读入的文本(用@作为文本结束标志)输出到一个名为bi.dat的新文件中,请填空。
#include <stdio.h>
#include<stdlib.h>
FILE*fp;
main()
charch;
if((fp=fopen( 【19】 ))==NULL)exit(0);
while((ch=getchar())!=’@’) fputc(ch,fp);
fclose(fp);

【参考答案】

"bi.dat","w"或"bi.dat","w+\
<上一题 目录 下一题>
热门 试题

填空题
下列程序的功能是:求出ss所指字符串中指定字符的个数,并返回此值。 例如,若输入字符串123412132,指定字符1,则输出3。请填空。 #include<stdio.h) #deftne M 81 int fun(char * ss,char c) int i=0; for(; 【18】 ;ss++) if(*ss==c) i++; return i; main() char a[M],ch; printf( nPlease enter a string: );gets(a); printf( nPlease enterachar: );ch=getchar(); printf( nThe number of the char is:%d n ,fun(a,ch));
填空题
下列程序的运行结果是 【17】 。 #include <stdio.h> #define M 100 void fun(int m,int *a,int *n) int i,j=0; for(i=1;i<=m; i++) if(i%7==0||i%11==0) a[j++]=i; *n=j; main() int aa[M],n,k; fun(10,aa,&n); for(k=0;k<n;k++) if((k+1)%20==0) printf( n ); else printf( %4d ,aa[k]); printf( n );
相关试题
  • 设有如下宏定义: #define MYSW AP(z...