码迷,mamicode.com
首页 > 其他好文 > 详细

本来想好好背单词。。。

时间:2018-05-02 16:23:30      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:space   ace   ++   play   its   get   display   puts   family   

 

技术分享图片

技术分享图片

懒得写爬虫(不会),花一分钟写个匹配答案。然后又不能好好背单词了。。。,存一下以后说不定其他作业用得到

 1 #include <bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 map<string, string> map1, map2;
 6 
 7 char s1[105], s2[105], s3[105], str[105];
 8 
 9 int main()
10 {
11     freopen("Answer.txt", "r", stdin);
12     while(gets(s1)) {
13         gets(s2);
14         gets(s3);
15         map1[s1] = s2;
16         map2[s2] = s1;
17     }
18     freopen("CON", "r", stdin);
19     while(gets(str)) {
20         puts("============");
21         if(map1.count(str)) {
22             cout << map1[str] << endl;
23         }
24         if(map2.count(str)) {
25             cout << map2[str] << endl;
26         }
27         puts("============");
28     }
29 
30     return 0;
31 }

 

本来想好好背单词。。。

标签:space   ace   ++   play   its   get   display   puts   family   

原文地址:https://www.cnblogs.com/Q1143316492/p/8979793.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!