U E D R , A S I H C RSS

비밀키/강희경

~cpp 
#include<iostream>  
#include<fstream>  
using namespace std;  
  
void main()  
{  
        char fileName[10];  
        cout << "암호화 입력 파일이름: ";  
        cin >> fileName;  
        ifstream fin(fileName);  
        ofstream fout("output.txt");  
        char temp;  
        while(fin.get(temp))  
        {  
                temp += 3;                      //비밀키 +3  
                fout << temp;  
                cout << temp;  
        }  
        fin.close();  
		fout.close();  
      
        
		cout << "\n복호화 출력 파일이름: ";  
        cin >> fileName;  
        ifstream fin1("output.txt");  
        ofstream fout1(fileName);   
        while(fin1.get(temp))  
        {  
                temp -= 3;                      //비밀키 -3  
                fout1 << temp;  
                cout << temp;  
        }  
        fin1.close();  
        fout1.close();  
}  
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:36
Processing time 0.0096 sec