?? substitution.cpp
字號:
#include <iostream.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#define offset 5
void main()
{
clrscr();
char msg[50];
int i,l;
char encrypt[26];
char k;
k='A';
for(i=0;i<26;i++,k++)
{
if(char(k+offset)<='Z')
;
else
{
k='A'-5;
}
encrypt[i]=char(k+offset);
}
cout<<"\n\n\t\t\tEncryption by Substitution";
cout<<"\n\tEnter your message : ";
gets(msg);
i=0;
l=strlen(msg);
for(i=0;i<l;i++)
{
msg[i]=toupper(msg[i]);
msg[i]=encrypt[int(msg[i]-'A')];
}
cout<<"\n\tEncrypted message is : ";
puts(msg);
getch();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -