Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char* argv[]){
- setlocale(LC_ALL, "Russian");
- string alphabet;
- string type;
- int key;
- string source;
- string dest;
- bool help = false;
- if (check(argv[argc - 3])){
- int key = atoi(argv[argc - 3]);
- string source = argv[argc - 2];
- string dest = argv[argc-1];
- argc = argc - 3;
- }
- else if (check(argv[argc - 2])){
- int key = atoi(argv[argc - 2]);
- string source = argv[argc-1];
- string dest = argv[argc-1];
- argc = argc - 2;
- }
- else {
- cout << "Неправильно введены данные" << endl;
- }
- for (int i = 0; i <= 10; i++){
- if (argv[i] == "-a") string alphabet = argv[i + 1];
- if (argv[i] == "-t"){
- string type = argv[i + 1];
- if (type == "encode") key = key;
- else if (type == "decode") key = -key;
- else {
- cout << "Неправильно введены данные" << endl;
- }
- }
- if (argv[i] == "-type=encode") key = key;
- else
- if (argv[i] == "-type=decode") key = -key;
- if (argv[i] == "--help") help = true;
- if (argv[i] == "-h") help = true;
- }
- if (help){
- cout << endl << endl;
- ifstream HelpUsMan("help.txt");
- while (!HelpUsMan.eof()){
- string strHelpUsMan;
- getline(HelpUsMan, strHelpUsMan);
- cout << strHelpUsMan << endl;
- }
- HelpUsMan.close();
- }
- else
- file(alphabet, key, source, dest);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement