2017上海市高校程序设计邀请赛_L
2017-07-04 17:39
246 查看
problem list
L 语言辨别
观察题
发现中文拼音里面最长的是类似于 zhuang 的,即最长6个字符
对于英文来说,查找特定词,查找介词、冠词和不定冠词为主:is,are,and,in,on……
然后剩下的就判定是日文
L 语言辨别
发现中文拼音里面最长的是类似于 zhuang 的,即最长6个字符
对于英文来说,查找特定词,查找介词、冠词和不定冠词为主:is,are,and,in,on……
然后剩下的就判定是日文
#include <bits/stdc++.h> using namespace std; typedef long long LL ; typedef unsigned long long ULL ; const int maxn = 1000 + 10 ; const int inf = 0x3f3f3f3f ; const int npos = -1 ; const double eps = 1e-20 ; std::string str; int sz, cnt; int main(){ // freopen("in.txt","r",stdin); // freopen("out.txt","+aw",stdout); int chi=0, jap=0, eng=0, maxcnt=0; while(getline(cin,str)){ sz=str.size(); cnt=0; for(int i=0;i<sz;i++){ if(' '==str[i]){ maxcnt=max(maxcnt,cnt); cnt=0; }else{ cnt++; } } if(std::string::npos!=str.find(" is ")){ eng=1; } if(std::string::npos!=str.find(" are ")){ eng=1; } if(std::string::npos!=str.find(" and ")){ eng=1; } if(std::string::npos!=str.find(" in ")){ eng=1; } if(std::string::npos!=str.find(" on ")){ eng=1; } } if(maxcnt<=6){ chi=1; } if(eng){ cout<<"English"<<endl; }else if(chi){ cout<<"Chinese"<<endl; }else{ cout<<"Japanese"<<endl; } return 0; }
相关文章推荐
- 2017上海市高校程序设计邀请赛_K
- 2017上海市高校程序设计邀请赛_E
- 2017上海市高校程序设计邀请赛_A
- 2017上海市高校程序设计邀请赛_F
- 2017上海市高校程序设计邀请赛_C
- 2017上海市高校程序设计邀请赛_G
- 2017上海市高校程序设计邀请赛_I
- 上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛 C. 神奇怪兽在哪里
- k.计软联谊 「游族杯」上海市高校程序设计邀请赛(数论)
- 「游族杯」上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛
- 「游族杯」上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛 A. 足球锦标赛
- 「游族杯」上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛 E.章鱼哥没有女朋友
- 「游族杯」上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛 (重现)
- 游族杯」上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛 (重现)F. 蚂蚁
- 「游族杯」上海市高校程序设计邀请赛暨华东师范大学第九届 ECNU Coder 程序设计竞赛 (重现) Problem D. 萝莉理论计算机科学家
- 2017陕西省大学生程序设计竞赛邀请赛总结!
- 华南理工大学第二届“超级码力”程序设计竞赛暨广东省高校邀请赛
- 2017武汉大学华中地区程序设计邀请赛个人感悟
- 大学生程序设计竞赛暨西南地区高校邀请赛 赛后总结
- 第五届华中区程序设计邀请赛暨武汉大学第十四届校赛 网络预选赛 A Minimum Sum 树状数组