//Ex6_25.cpp
#include "iostream" 
#include "fstream" 
using namespace std;
void main() 
{int count=0;
 char myfile[80],s[100]; 
 cout<<"源文件名：";
 cin>>myfile;
 ifstream inf(myfile); 
 if(!inf) 
	{cout<<myfile<<"can't open!"<<endl; 
	 abort(); } 
while(!inf.eof()) 
	{inf.getline(s,sizeof(s));
	 count++;}
 cout<<myfile<<"共有:"<<count<<"行!"<<endl; 
 inf.close();
}  
