2011_1华中科技大学机试真题
来源:互联网 发布:一个c语言源程序是由 编辑:程序博客网 时间:2024/04/30 10:36
#include<stdio.h>#include<stdlib.h>int main(){FILE *fp,*fp1;char e;int flag,count1,count2,count3;if((fp=fopen("D:\\abc0.txt","w"))==NULL){printf("文件打开失败!\n");exit(1);}while((e=getchar())!=EOF)fputc(e,fp);fclose(fp);if((fp1=fopen("D:\\abc1.txt","w"))==NULL){printf("文件打开失败!\n");exit(1);}if((fp=fopen("D:\\abc0.txt","r"))==NULL){printf("文件打开失败!\n");exit(1);}flag=0;while((e=fgetc(fp))!=EOF){if(e==' '){if(flag==1) continue;fputc(e,fp1);printf("%c",e);flag=1;continue;}else{fputc(e,fp1);printf("%c",e);flag=0;continue;}}fclose(fp);fclose(fp1);if((fp1=fopen("D:\\abc1.txt","r"))==NULL){printf("文件操作失败!\n");exit(0);}count1=count2=count3=0;while((e=fgetc(fp1))!=EOF){count1++;if(e==' '||e==':'||e==':'||e=='\''||e=='\"'||e=='.'||e=='!'||e=='?')count2++;if(e=='.'||e=='!'||e=='?')count3++;}printf("\n%d\t%d\t%d\n",count1,count2,count3);fclose(fp1);system("pause");return 0;}此题没有测试,所以不能说完全正确!
0 0
- 2011_1华中科技大学机试真题
- 2012_1华中科技大学机试真题
- 2011_2华中科技大学机试真题
- 2011_3华中科技大学机试真题
- 2012_2华中科技大学机试真题
- 2011华中科技大学研究生复试机试之一
- 2011华中科技大学研究生复试机试之二
- 2011华中科技大学研究生复试机试之三
- Programming Notes 2011_1
- 2011级华中科技大学软件学院软件工程硕士培养方案(附课表)
- 华中科技大学的IP
- 华中科技大学社会系
- CentOS5华中科技大学更新源
- 06华中科技大学复试上机
- 华中科技大学IPV6设置,linux
- 华中科技大学海外校友录
- 华中科技大学网络教材
- 黑晓军 华中科技大学 博士 副教授
- java线程池的使用&&使用线程池完成同步
- 【网络】socket通讯原理以及tcp、ip三次握手机制分析
- 用栈实现进制转换
- nginx 多域名配置,采用多配置文件的方式GOOD
- jquery实现联想词搜索框和搜索结果分页
- 2011_1华中科技大学机试真题
- Hive的数据存储模型
- nslookup工具的使用方法
- 项目TestSC2SpO2DataToExcel
- 2011_2华中科技大学机试真题
- python学习笔记-(3)序列-Sequence
- HDU ACM 2206 IP的计算
- 有关Grails的事务
- Merge讲解与实例