//Ex6_24.cpp
#include "iostream" 
#include "fstream" 
using namespace std;
void main() 
{ofstream outfile; 
 char myfile[80];
 cout<<"源文件名：";
 cin>>myfile;
 outfile.open(myfile);   //以写的方式打开文件 
 if(!outfile)   //检查文件是否正常打开 
	{cout<<myfile <<" can't open"<<endl; 
     abort();}  //打开失败，结束程序 
 char ch='a'; 
 while(ch<='z') 
	{outfile<<ch; 
	 ch++;} 
 outfile.close(); 
 fstream infile(myfile,ios::in); //以读的方式打开文件 
 while(infile>>ch) 
 cout<<ch; 
 cout<<endl; 
 infile.close();
}
