#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
int main()
{
   ifstream inFile;
   int sales,day;
   inFile.open("sales.dat",ios::in|ios::binary);
   if(inFile.fail()){
    cout<<" can't open file!";
   }
   cout<<"  Enter day for print: ";
   cin>>day;
   inFile.seekg(0);
     inFile.seekg((day*4)-4,ios::beg);
   inFile.read((char *)(&sales),sizeof(int));
   cout<<"  amount sales is : "<<sales;
   return 0;
}
