void student(string s ,ifstream &in)
{
// read each line and compare the name s
}
int main()
{
string s; cin>>s; // input string
ifstream in;
in.open("Text1.txt");
student(s, in);
system("pause");
return 0;
}
#include<iostream>
#include<ifstream>
using namespace std;
void student(string s, ifstream &in)
{
string name;
string phone_number;
long long int id;
in >> name >> id >> phone_number;
if (s == name) {
cout << name << ' ' << id << ' ' << phone_number << endl;
}
}
int main()
{
string s; cin>>s; // input string
ifstream in;
in.open("Text1.txt");
student(s, in);
system("pause");
return 0;
}
Comments
Leave a comment