#include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
using std::cout;
using std::endl;
int main()
{
static const char *fileName = "d:\\data.txt";
std::string s;
{
std::ifstream file(fileName);
char ch;
while (file.get(ch))
s += ch;
}
int N = 3;
std::reverse(s.begin(), s.begin() + N);
{
std::ofstream file(fileName);
file << s;
}
return 0;
}
/*
run:
++c c
c# java php python
*/