1

来源:互联网 发布:湘阴县知源中学 编辑:程序博客网 时间:2024/05/16 05:37

#include "stdio.h"
#include "string.h"
#define MAX_ROW 100
#define MAX_COL 200
void decryption(char s[])
{

 int i;
for(i=0;s[i];++i)

  if(s[i]>='A'&&s[i]<='Z')

   //if(s[i]>85)

    //s[i]=69-90%s[i];
if(s[i]>69)
    s[i]-=5;
    else

     s[i]+=21;

}

void main()

{

    int i=0,j=0;

    char s[MAX_ROW][MAX_COL+1];

    char t[MAX_COL+1];

    while(strcmp(gets(t),"ENDOFINPUT"))

    if(strcmp(t,"START")&&strcmp(t,"END"))

     strcpy(s[i++],t);

    for(;j<i;++j)

     decryption(s[j]);

    printf("After decrypted:\n");

    for(j=0;j<i;++j)

     puts(s[j]);

}