#include #include #include int main(){ ifstream InFile("decrypt.txt", ios::nocreate); //ofstream OutFile("decrypted.txt"); fstream OutFile("decrypted.txt", ios::in | ios::out); if(InFile.fail()){ cout << "File could not be opened"; return(0); } else{ char ch1, ch2; InFile.seekg(0,ios::end); int end = InFile.tellg(); InFile.seekg(0); for(int a = 0, int b = 1; InFile.eof() != 1;a+=2, b+=2){ //InFile.seekg(a); InFile >> ch1; //InFile.seekg(b); InFile >> ch2; if(b < end) OutFile << ch2; if(a < end) OutFile << ch1; } String S; OutFile.seekg(0); //OutFile >> S; getline(OutFile, S); cout << S << endl; } return(0); }