标签:des style blog class code java
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7995 Accepted Submission(s): 5229
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
43 |
#include<stdio.h> #include<string.h> int main() { char
s[50005],t[50005]; int
i,j,l1,l2,ans; while (~ scanf ( "%s%s" ,s,t)) { if (s[0]== ‘#‘ ) break ; i=j=0; ans=0; l1= strlen (s); l2= strlen (t); while (i!=l1) { if (s[i]==t[j]) { if (j==l2-1) { ans++; j=-1; } i++; j++; } else { if (j==l2) { j=0; ans++; } else j=0; i++; } } printf ( "%d\n" ,ans); } } |
标签:des style blog class code java
原文地址:http://www.cnblogs.com/cancangood/p/3712528.html