日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

hdu 1075 map

發布時間:2024/6/18 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 hdu 1075 map 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題意:給一個字典,和一句話,翻譯一下

奇怪的格式

Sample Input START from fiwo hello difh mars riwosf earth fnnvk like fiiwj END START difh, i'm fiwo riwosf. i fiiwj fnnvk! END Sample Output hello, i'm from mars. i like earth! 1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 #include<cmath> 6 #include<queue> 7 #include<map> 8 using namespace std; 9 #define MOD 1000000007 10 const double eps=1e-5; 11 #define cl(a) memset(a,0,sizeof(a)) 12 #define ts printf("*****\n"); 13 const int MAXN=1005; 14 map<string,string> mp; 15 int n,m,tt; 16 int main() 17 { 18 int i,j,k; 19 #ifndef ONLINE_JUDGE 20 freopen("1.in","r",stdin); 21 #endif 22 string str1,str2; 23 cin>>str1; 24 while(cin>>str1) 25 { 26 if(str1=="END") break; 27 cin>>str2; 28 mp[str2]=str1; 29 } 30 cin>>str1; 31 char ch; 32 ch=getchar(); 33 str1=""; 34 while(1) 35 { 36 while(1) 37 { 38 scanf("%c",&ch); 39 if(!((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))) break; 40 str1+=ch; 41 } 42 if(str1=="END") break; 43 if(mp.find(str1)==mp.end()) cout<<str1; //并未在字典中找到 44 else cout<<mp[str1]; 45 str1=""; 46 printf("%c",ch); //符號或空格 47 } 48 return 0; 49 }

?

轉載于:https://www.cnblogs.com/cnblogs321114287/p/4433702.html

總結

以上是生活随笔為你收集整理的hdu 1075 map的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。