首页 > 其他 > 详细

HDU 1075 What Are You Taking About

时间:2016-02-02 16:18:37      阅读:215      评论:0      收藏:0      [点我收藏+]

字符串转化,模拟过程就做出来了,用了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

原文:http://www.cnblogs.com/livelihao/p/5177603.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!