记录编号 |
283717 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[暑假培训2012] 单词缩写 |
最终得分 |
100 |
用户昵称 |
@@@ |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.006 s |
提交时间 |
2016-07-15 11:14:01 |
内存使用 |
0.32 MiB |
显示代码纯文本
- #include <fstream>
- #include <string>
- #include <cstdio>
- using namespace std;
- ifstream cin("abbreviation.in");
- ofstream cout("abbreviation.out");
- int n,wl;
- string word;
- char test;
- int main()
- {
- int i;
- cin>>n;
- while(cin>>word)
- {
- wl=word.length();
- test=cin.get();
-
- for(i = 0; i < wl; i++)
- word[i] = toupper(word[i]);
- if(wl<3||word=="THE"||word=="AND"||word=="FOR")
- {
- if(test=='\n')
- cout<<endl;
- continue;
- }
- cout<<word[0];
- if(test=='\n') cout<<endl;
- }
- cin.close();
- cout.close();
- return 0;
- }