I had to write a program that read the encrypted message... ":mmZ\dxZmx]Zpgy"
This was accomplished. The completed program is below, however it is set up now so that a user will input an encrypted message and then the program will decrypt the message. I dont want this. pretty much I want to run the program and have it automatically consider ":mmZ\dxZmx]Zpgy"
as the message that is already input. How do I do that?
Code:#include<iostream> using namespace std; int main() { char in[100]; char out[100]; int key,count; cout<<"Enter encrypted code: "; cin.getline(in,100); for(key=1;key<=100;key++) { for(count=0;in[count]!='\0';count++) { if(in[count]-key<32) out[count]=in[count]-key-32+127; else out[count]=in[count]-key; } cout<<"Key "<<key<<" Decoded Message: "; cout<<out<<endl; } system("pause"); return 0; }



LinkBack URL
About LinkBacks


