If you have file "text.txt" at the same place where you .cpp file it should work:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
int result = 0;
string date;
ifstream f;
f.open("text.txt");//filename, must be here
if (f.is_open())
{
getline(f,date);
f >> result;
f.close();
cout << result << endl;
}