ifstream ifs;
ifs.open("C://Users/Administrator.DESKTOP-O3I63TK/Desktop/3.10/weben.txt",ios::in);
if(ifs.is_open())
{
cout<<"打开成功"<<endl;
}
else {
cout<<"打开失败"<<endl;
}
string str;
while(getline(ifs,str))
cout<<str<<endl;
ifs.close();
ifstream ifs;
ifs.open("C://Users/Administrator.DESKTOP-O3I63TK/Desktop/3.10/weben.txt",ios::in);
if(ifs.is_open())
{
cout<<"打开成功"<<endl;
}
else {
cout<<"打开失败"<<endl;
}
string str;
while(getline(ifs,str))
cout<<str<<endl;
ifs.close();