编写一个程序,要求使用C++

[复制链接]
查看11 | 回复1 | 2010-10-12 12:02:12 | 显示全部楼层 |阅读模式
有两个磁盘文件“A”和“B”,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列),输出到一个新文件“C”中。

回复

使用道具 举报

千问 | 2010-10-12 12:02:12 | 显示全部楼层
#include #include #include
//这个一定要包含,不然sort不能用using namespace std;void main(){ ifstream fileA("A"); ifstream fileB("B"); ofstream fileC("C");
string strA; string strB; string strC; getline(fileA,strA); getline(fileB,strB); strC = strA + s
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行