欧美古代历史战争电影:悬赏跪求!!!谁会做C语言的题?请教。。

来源:百度文库 编辑:神马品牌网 时间:2024/05/03 09:28:48
以下函数用来在W数组中插入X,W数组中的树已按由小到大顺序存放,N所指存储单元中窜放数组中数据的个数,插入后数组中的树仍有序,请填空void fun(char *w,char x,int *n)
{int i,p;
p=0
w[*n]=x;
while(x>w[p]) ?
for(i=*n;i>p;i--) w[i]= ?
w[p]=x;
+-*n;
}

以下程序用来统计文件中字符的个数,请填空
#include "stdio.h"
main()
{FILE *fp;
long num=0;
if((fp=foopen("fname.dat",___?___))==null)
{printf("open error\n"); exit(0)}
while ___?___
{___?___
num -+;
}
printf("num=%(d\n",num);
fclose(fp);
}

#include "stdio.h"
void main()
{
FILE *fp;
long num=0;
if((fp=fopen("1.txt","r"))==NULL)
{
printf("open error\n");
exit(0);
}
while(fgetc(fp)!=EOF)
{//___?___
num ++;
}
printf("num=%d\n",num);
fclose(fp);
}
不会只是计算字符数吧,是不是还要输出字符啊,中间那个空不知道填什么 ,第一个没看明白,你确定没打错字。

看看潭浩强的C语言课本吧,应该是在文件操作那一部分
或者就是原题呢。

虽然我不是很会做。但我祝你成功……