#include<iostream>
#include<fstream>
#include<string>
using namespace std;
class chih
{
};
int main()
{
fstream in("chih.txt", ios::in);
if (!in)
{
cout << "fail to open." << endl;
exit(1);
}
fstream out("chih2.txt", ios::out|ios::app);
if (!out)
{
cout << "fail to open." << endl;
exit(1);
}
char ah;
while (!in.eof())
{
if (!'\r\n')//我想遇到个换行符就跳过去,这样貌似不行-0-??
{
in.get(ah);
out.put(ah - 32);
}
else
{
in.get(ah);
out.put(ah);
}
}
in.close();
out.close();
return 0;来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2001/viewspace-3134513/ ,如需转载,请注明出处,否则将追究法律责任。