-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1204.cpp
More file actions
42 lines (35 loc) · 853 Bytes
/
1204.cpp
File metadata and controls
42 lines (35 loc) · 853 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
39
40
41
42
/*************************************************************************
> File Name: 1204.cpp
> Author: dulun
> Mail: [email protected]
> Created Time: 2016年05月14日 星期六 20时08分59秒
************************************************************************/
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#define LL long long
using namespace std;
const int N = 50086;
int main()
{
char a[N], b[N];
scanf("%s%s", a, b);
int la = strlen(a);
int lb = strlen(b);
for(int i = 0; i <= la - lb; i++)
{
int k = 0, m = i;
while(a[m] == b[k])
{
m++, k++;
if(k == lb)
{
printf("%d\n", i+1);
return 0;
}
}
}
return 0;
}