dks | Date: Monday, 24 February 14, 5:56 PM | Message # 1 |
New Lit
Group: Friends
Messages: 4
Status: Offline
| #include <iostream> #include <fstream>
using namespace std;
void encrypted() { ifstream in; ofstream out; char line; // int c=0; in.open("input.txt",ios_base::in); out.open("encrypted.txt",ios_base::out); if(in.is_open()) { while(!in.eof()) { // c++; in.get(line); int b=int(line); b=255-b; char ch=char(b); if(!in) break; cout<<ch; out<<ch; } cout<<endl; in.close(); out.close(); } }
void decrypted() { ifstream in; ofstream out; char line; in.open("encrypted.txt",ios_base::in); out.open("Finaloutput.txt",ios_base::out); if(in.is_open()) { while(!in.eof()) { in.get(line); int b=int(line); b=255-b; char ch=char(b); if(!in) break; out<<ch; cout<<ch; } in.close(); out.close(); } }
int main() { encrypted(); decrypted(); return 0; }
|
|
| |