‘壹’ 大神帮忙写一篇C语言程序设计综合性实验
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#defineMAXSIZE36
structWord{
charword[MAXSIZE];
unsignedsize;
}words[10000];
intn=0;
voidSort(){
//没有时间写了
}
voidAdditive(charword[]){
inti,flag=1;
for(i=0;i<n&&flag;++i){
if(strcmp(words[i].word,word)==0){
++words[i].size;
flag=0;
}
}
if(flag){
strcpy(words[n].word,word);
words[n].size=1;
++n;
}
}
intmain(){
inti,ch;
charword[MAXSIZE];
FILE*fin=fopen("case1.in","rt");
if(fin==NULL){
printf("无法打开数据文件! ");
return1;
}
i=0;
while((ch=fgetc(fin))!=EOF){
if(isalpha(ch))word[i++]=tolower(ch);
elseif(i){
word[i]='