11C第7章函数与指针2.pptVIP

  • 1
  • 0
  • 约 41页
  • 2017-06-25 发布于四川
  • 举报
int main() { Rectangle rec; int tlx, tly, brx, bry; coutPlease input four integers for the two vertex of rectangle in the order: endl; couttopleft_x topleft_y bottomright_x bottomright_yendl; cintlxtlybrxbry; rec=Input(tlx, tly, brx, bry); cout“Area=”GetArea(rec)endl; return 0; } 主函数 例10 词频统计 输入一系列英文单词,单词之间用空格隔开,用“xyz”表示输入结束,统计输入过哪些单词以及各单词出现的次数,统计时区分大小写字母,最后按单词的字典顺序输出单词和出现次数的对照表。 struct WordList { char word[50]; //单词 int freq; //频数 }; 结构体类型定义: WordList list[5000]; //单词表 程序结构: main()输入单词并进行词频统计 Sort()排序 Print()输出 关键程序段-输入并统计单词 WordList list[5000]; //单词表

文档评论(0)

1亿VIP精品文档

相关文档