Friday, April 11, 2014

UVa Solution 12592 - Slogan Learning of Princess


#include<iostream>
#include<cstdio>
#include<map>
#include<sstream>
#include<cstring>
#include<istream>
using namespace std;
map<string, string>M;

int main()
{
    string s1, s2;
    int test, n;
    cin >> test;
    cin.ignore();
    while(test--)
    {
        getline(cin, s1);
        getline(cin, s2);
        M[s1] = s2;
    }
    cin>>n;
    cin.ignore();
    while(n--)
    {
        string s3;
        getline(cin, s3);
        cout << M[s3] <<endl;
    }
    return 0;
}

No comments:

Post a Comment

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...