>come on prelude, i know YOU can do this
Ack, busted
>you are the best programmer here
Definitely not, Salem is better for sure, and quite a few others.
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
string DeCrypto(string eText)
{
char ff = ' ', c1, c2, k;
string dText;
char hold[BUFSIZ] = {0};
for(int i = 0; i < eText.length() / 2; i++) {
c1 = eText[2 * i];
c2 = eText[2 * i + 1];
if(c1 > c2)
k = (char)((c1 - c2) + ff);
else
k = (char)((c2 + c1) - ff);
hold[i] = k;
}
dText = hold;
return dText;
}
int main ( void )
{
fstream in("test.txt");
string a, b;
while ( in.good() ) {
getline ( in, a );
b = DeCrypto ( a );
cout<< b <<"\n";
}
return 0;
}
You might want to verify the decrypted data, it looks odd. The algorithm is the same so it may be buggy.
-Prelude