Professional Documents
Culture Documents
#include<stdio.h>
#include<string.h>
#include<conio.h>
class Substitution
char str[500];
public:
void sgetstring();
void sencryption();
void sdecryption();
};
void Substitution::sgetstring()
void Substitution::sencryption()
char c;
c = str[i];
if (c == -1)
break;
if (isupper(c))
t1 = t1 + (int) 'A';
else if (islower(c))
t1 = t1 + (int) 'a';
else{
cout << c;
void Substitution::sdecryption()
c = str[i];
if (c == -1)
break;
if (isupper(c))
t1 = t1 + (int) 'A';
else if (islower(c))
t1 = t1 + (int) 'a';
else{
cout << c;
int main()
int choice;
Substitution s;
s.sgetstring();
if (choice == 1)
s.sencryption();
else
s.sdecryption();
getch();
return (0);
}