#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main(){
ifstream file;
file.open("C://Users//86178//Desktop//aaa.txt");
if (!file.is_open())
cout << "open file failure" << endl;
string s;
getline(file,s);
cout<<s;
return 0;
}
即可