Skip to content

Commit

Permalink
Stop a while when have a blank line in input
Browse files Browse the repository at this point in the history
  • Loading branch information
darkv314 committed Apr 3, 2020
1 parent 6e70f66 commit 2b8b382
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions babelfishUVA.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <bits/stdc++.h>
#define fori(x,y) for(int i = x ; i < y ; i++)
#define forj(x,y) for(int j = x ; j < y ; j++)

using namespace std;

char s[1005], ss[1005];
string s1,s2;
map<string, string> mp;

int main()
{
while(gets(s) && s[0]!='\0')
{
stringstream sss;
sss<<s;
sss>>s1;
sss>>s2;
mp[s2]=s1;
}
while(cin>>s1)
{
if(mp[s1]!="")
cout<<mp[s1]<<endl;
else
cout<<"eh"<<endl;
}
}

0 comments on commit 2b8b382

Please sign in to comment.