-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1131.cpp
More file actions
38 lines (36 loc) · 789 Bytes
/
Copy path1131.cpp
File metadata and controls
38 lines (36 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*************************************************************************
> File Name: 1131.cpp
> Author: dulun
> Mail: dulun@xiyoulinux.org
> Created Time: 2015年11月17日 星期二 21时57分29秒
************************************************************************/
#include<iostream>
#include<stdio.h>
#include<cstring>
using namespace std;
int main()
{
string a[1000];
string world;
cin>>world;
int start = -1;
int count = 0;
int num = 0;
for(int i = 0; i < 1000; i++)
{
cin>>a[i];
num++;
}
for(int i = 0; i <= num; i++)
{
if(count == 0 && a[i] == world)
{
start = i;
}
if(a[i] == world)
{
count++;
}
}
cout<<start<<" "<<count;
}