分页:
上一页 1 2 3 4 5 6 [7] 8 9 10 下一页
txt3.Text=""
End Sub
Private Sub cmdClose_Click()
(5) '退出应用程序
End Sub
试题六 (试题六和试题七选做一题)
阅读下列函数说明和C函数,将应填入 n 处的字句写在答题纸的对应栏内。
[程序说明]
本程序从正文文件text.in中读入一篇英文短文,统计该短文中不同单词及出现次数,并按词典编辑顺序将单词及出现次数输出到正文文件word.out中。
程序用一棵有序二叉树存储这些单词及其出现的次数,边读入边建立,然后中序遍历该二叉树,将遍历经过的二叉树上的结点的内容输出。
# include <stdio.h>
# include <malloc.h>
# include <ctype.h>
# include <string.h>
# define INF "text.in"
# define OUTF "word.out"
typedef struct treenode {
char *word;
int count;
struct treenode *left, *right;
} BNODE;
int getword(FILE *fpt, char *word)
{ char c;
c=fgetc(fpt);
if ( c == EOF)
return 0;
while(!(tolower(c) >= 'a' && tolower(c) <= 'z'))
{ c=fgetc(fpt);
if ( c == EOF)
return 0;
} /* 跳过单词间的所有非字母字符 */
while(tolower(c) >= 'a' && tolower(c) <= 'z')
{ *word++ = c;
c = fgetc(fpt);
}
分页:
上一页 1 2 3 4 5 6 [7] 8 9 10 下一页