poj3749

来源:互联网 发布:des算法c语言讲解 编辑:程序博客网 时间:2024/06/03 21:25

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

 


int main()
{

    char str[200];
    char *p;
    gets(str);
    while(strcmp(str,"ENDOFINPUT") != 0)
    {
    if(strcmp(str,"START")==0)
    {
    gets(str);
    p = str;

    while(*p != '/0')
    {
     if(*p >= 'F')
        *p = *p-5;
    else
    {
    if(*p == 'E') *p = 'Z';
        if(*p == 'D') *p = 'Y';
     if(*p == 'C') *p = 'X';
    if(*p == 'B') *p = 'W';
    if(*p == 'A') *p = 'V';
    }
       p++;
   
    }
    puts(str);
    }
  
    gets(str);
    if(strcmp(str,"END") == 0)
        gets(str);
  }
 
  
  return 0;
}

原创粉丝点击