Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #include <string>
- #include <iomanip>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- char option, m, c;
- int amount, n, k;
- string fname, dname, ename;
- ofstream nstream;
- ifstream istream;
- cout << "Do you want to encrypt of decrypt? Enter D or E.";
- cin >> option;
- cout << endl;
- while (option != 'D' && option != 'E')
- {
- cout << "That is not acceptable" << endl;
- cout << "Do you want to encrypt of decrypt? Enter D or E.";
- cin >> option;
- cout << endl;
- }
- if (option == 'E')
- {
- cout << "Enter the name of the file that you want to encrypt: ";
- cin >> fname;
- istream.open(“fname”);
- cout<<endl;
- cout << "Enter the name of the file that you want to output: ";
- cin >> ename;
- nstream.open(“ename”);
- cout<<endl;
- }
- if (option == 'D')
- {
- cout << "Enter the name of the file that you want to decrypt: ";
- cin >> dname;
- istream.open(“dname”);
- cout<<endl;
- cout << "Enter the name of the file that you want to output: ";
- cin >> ename;
- nstream.open(“ename”);
- cout<<endl;
- }
- cout << "Enter the number of digits that you want to de/encrypt(integers): ";
- cin >> k;
- istream >> m;
- while (m >= 0);
- {
- if (m > 65 && m < 90);
- {
- c = m + k;
- while (c > 90)
- {
- c = c - 26;
- }
- }
- if (m > 97 && m < 122);
- {(c = m + k);
- while (c > 122)
- {
- c = c - 26;
- }
- }
- if(m >= 0)
- {
- c = m + k;
- }
- }
- nstream << c;
- cout<<"booty";
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement