HDU 1075 What Are You Taking About

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDU 1075 What Are You Taking About相关的知识,希望对你有一定的参考价值。

字符串转化,模拟过程就做出来了,用了string

 

#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#define ONLINE
using namespace std;
map<string,string>m;
int main(){
    string a,b;
    cin>>a;
    while(cin>>a&&a!="END"){
        cin>>b;
        m[b]=a;
    }
    char ch[5000];

    getchar();gets(ch);
    while(gets(ch)&&strcmp(ch,"END")){
        b="";
        for(int i=0;i<strlen(ch);i++){
            if(ch[i]<=z&&ch[i]>=a){
                b+=ch[i];
            }
            else{
                if(m[b]!="")
                    cout<<m[b];
                else
                    cout<<b;
                putchar(ch[i]);
                b="";
            }
        }
        puts("");
    }
    return 0;
}

 

以上是关于HDU 1075 What Are You Taking About的主要内容,如果未能解决你的问题,请参考以下文章

HDU 1075 What Are You Taking About

hdu 1075 What Are You Talking About

hdu 1075 What Are You Talking About (map)

HDU 1075 What Are You Talking About (Trie)

HDU1075 What Are You Talking About STL

HDU 1075 - What Are You Talking About