1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
int SIZE = 26;
char data;
int x = 0;
ifstream fin;
fin.open("eFile.txt");
if(!fin)
{
cout << "Program is terminated - cannot locate input file";
cout << " or wrong file name.";
return 1;
}
char letters[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\0'};
char encryptL[] = {'E', 'M', 'N', 'V', 'D', 'L', 'W', 'A', 'U', 'C', 'P',
'O', 'K', 'X', 'Q', 'B', 'I', 'Z', 'J', 'R', 'Y', 'T', 'G', 'S', 'H', 'F', '\0'};
int numbers[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int encryptN[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
char special[] = {'!', '$', '%', 39, '(', ')', '*', '+', ',', '-', '.', '/', ';',
'<', '=', '>', '?', '@', '[', ']', '}', '{', '\0'};
char encryptS[] = {'{', '}', ']', '[', '@', '?', '>', '=', '<', ';', '/', '.', '-',
',', '+', '*', ')', '(', 39, '%', '$', '!', '\0'};
char encryptSpace[] = {'^', '~', '#', '`', ':', '\0'};
while (fin)
{
fin.get(data);
if (data >= 'A' && data <='Z' || data >='a' && data <= 'z')
{
if (islower(data))
data = toupper(data);
cout << data;
}
else if (data == 32)
cout << data;
else if (data >= 33 && data <= 47)
cout << data;
else if (data >= 48 && data <= 57)
cout << data;
}
return 0;
}
|