比赛 |
防止颓废的小练习v0.15 |
评测结果 |
WAWAWWWWWW |
题目名称 |
统计单词数 |
最终得分 |
20 |
用户昵称 |
Aeons |
运行时间 |
0.077 s |
代码语言 |
C++ |
内存使用 |
0.32 MiB |
提交时间 |
2016-10-17 20:50:13 |
显示代码纯文本
- #include <fstream>
- #include <string>
- using namespace std;
- ifstream fin("stat.in");
- ofstream fout("stat.out");
-
- int main()
- {
- string n;
- int i=1,j;
- int ans=0;
- string l;
- int k=1;
- int p;
- int t1=l.length();
- fin>>l;
- while(!fin.eof())
- {
- fin>>n;
- int t2=n.length();
- if(t2==t1)
- {
- for(j=0;j<t1;j++)
- {
- if(n[j]==l[j])
- k++;
- if(n[j]>='A'&& n[j]<='Z')
- if(n[j]+'a'-'A'==l[j])
- k++;
- if(n[j]>='a'&& n[j]<='z')
- if(n[j]-('a'-'A')==l[j])
- k++;
- if(n[j]!=l[j])
- break;
- }
- if(k==t1)
- {
- ans++;
- if(ans=1);
- p=i;
- }
- k=1;
- }
- i++;
- }
- if(ans!=0)
- fout<<ans<<' '<<p;
- if(ans==0)
- fout<<-1<<endl;
- fin.close();
- fout.close();
- return 0;
- }