c程文件题目

[复制链接]
查看11 | 回复1 | 2011-6-19 17:55:37 | 显示全部楼层 |阅读模式
读一个指定的文本文件,显示在屏幕上,如果有大写字母,则改成小写字母再输出,并统计行数。根据回车符统计文件行数。要处理的文件名通过键盘读入字符串指定。
测试数据要求至少读入3行包含大写字母和其它字母混合的字符串

回复

使用道具 举报

千问 | 2011-6-19 17:55:37 | 显示全部楼层
#include #include #include void main( void ){FILE *fp;char ch;int n = 0;if ((fp = fopen("xinjian.txt","r")) == NULL){printf("Can not open this file\n");exit(0);}while((ch = fgetc(fp)) != EOF){if(ch >= 'A' && ch # include int main(void){int count;char s[10],ch;FILE *fp;gets(s);if((fp=fopen(s,"r"))==NULL){printf("File open error! \n");exit(0);...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行