C++编程要求:在x.txt文件中给出10个字符串,用程序读入,将每个字符串

[复制链接]
查看11 | 回复2 | 2010-6-3 17:01:15 | 显示全部楼层 |阅读模式
要求:在x.txt文件中给出10个字符串,用程序读入,将每个字符串中的元音字母组成新的字符串输出到x1.txt文件中。,。

回复

使用道具 举报

千问 | 2010-6-3 17:01:15 | 显示全部楼层
#include#includeint check( char ch ) {
if( ch == 'a' || ch == 'A' ) return 1 ;
if( ch == 'e' || ch == 'E' ) return 1 ;
if( ch == 'i' || ch == 'I' ) return 1 ;
if( ch == 'o' || ch == 'O' ) return 1 ;
if( ch == 'u' || ch == "U" ) return 1 ;
return 0 ;
回复

使用道具 举报

千问 | 2010-6-3 17:01:15 | 显示全部楼层
#include#includeusing namespace std;int main(){ ifstream x("e:\\x.txt"); ofstream x1("e:\\x1.txt"); char ch; while(x>>ch){if(ch=='a' || ch == '
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行