zoukankan      html  css  js  c++  java
  • HDU1048

    字符串处理的简单题

    View Code
     1 /*
     2 字符串处理 简单
     3 */
     4 #include<stdio.h>
     5 #include<stdlib.h>
     6 #include<string.h>
     7 #include<iostream>
     8 #include<algorithm>
     9 #include<queue>
    10 #include<map>
    11 #include<math.h>
    12 using namespace std;
    13 const int maxn = 305;
    14 const int inf = 0x7fffffff;
    15 char s[ maxn ],tmp[ maxn ];
    16 char solve( char ch ){
    17     if( ch>='F' ) return ch-5;
    18     if( ch=='E' ) return 'Z';
    19     if( ch=='D' ) return 'Y';
    20     if( ch=='C' ) return 'X';
    21     if( ch=='B' ) return 'W';
    22     if( ch=='A' ) return 'V';
    23 }
    24 int main(){
    25     while( scanf("%s",tmp)!=EOF && strcmp(tmp,"ENDOFINPUT")!=0 ){
    26         getchar();
    27         gets(s);//scanf("%s",s);
    28         //printf("\ns:%s\n",s);
    29         scanf("%s",tmp);
    30         int len=strlen( s );
    31         for( int i=0;i<len;i++ ){
    32             if( s[ i ]>='A' && s[ i ]<='Z' ) printf("%c",solve( s[i] ));
    33             else printf("%c",s[i]);
    34         }
    35         printf("\n");
    36     }
    37     return 0;
    38 }
    keep moving...
  • 相关阅读:
    Docker 安装 Logstash
    Docker 安装 Kibana
    go命令行参数
    小程序 表单提交
    小程序picker日历
    小程序,验证码倒计时效果
    flex图片垂直居中
    小程序单选框样式
    wechat-wxparse 使用
    小程序Banner跳转
  • 原文地址:https://www.cnblogs.com/xxx0624/p/2809198.html
Copyright © 2011-2022 走看看