Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void cezar(string a1,int key1,int caseChoose1){
- for(int i = 0; i<a1.length() ;i++){
- if (caseChoose1 == 1)
- a1[i] +=key1;//шифрование
- if (caseChoose1 == 2)
- a1[i] -=key1;//дешифрование
- }
- cout << a1 << endl;
- }
- int main (int argc[], char* argv[50])
- {
- setlocale(LC_ALL, "Russian");
- string a;
- int key,caseChoose;
- key = atoi(argv[1]);
- caseChoose = atoi(argv[2]);
- a = argv[3];
- cezar(a,key,caseChoose);
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement