#include<fstream.h>
 int main()
{
 char filename[2][30],ch;
 ifstream file1;
 ofstream file2;
 cout<<"请输入源文件名"<<endl;
 cin>>filename[0];
 cout<<"请输入目标文件名"<<endl;
 cin>>filename[1];
 file1.open(filename[0],ios::in); 
 if(file1.fail())
 {
  cerr<<"文件打开失败！"<<endl;
  return(1);
 } 
 file2.open(filename[1],ios::out); 
 if(!file2)
 {
  cerr<<"文件打开失败！"<<endl;
  return(1);
 }
 file1.get(ch);//从源文件读一个字符
 while(file1)
 {
  if(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z')
   file2.put(ch);//向目标文件写一个字母
  file1.get(ch);//从源文件读一个字符
 }
 file1.close(); 
 file2.close();
 return(0);
}

