-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathword.cpp
More file actions
72 lines (38 loc) · 1.04 KB
/
word.cpp
File metadata and controls
72 lines (38 loc) · 1.04 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int findString (const char * s0,const char *s1){
char *s= strstr(s0, s1);
if (s!= NULL) {
s+=strlen(s1);
// printf("here %s\n", s0);
return 1+findString( s, s1);
}
return 0;
}
int main(){
FILE *fp = fopen("c:/Users/owner/desktop/program/in.txt","r");
char *s1= "you";
fseek(fp,0,SEEK_END);
int size = ftell(fp);
fseek (fp, 0, SEEK_SET);
printf("here %d\n",size);
char s0[size];
fread(s0,1,size,fp);
printf("%s", s0);
//char *s= strstr(s0, s1);
//printf("%s\n", s);
system("pause");
if (fp!=NULL)
printf("%d", findString(s0, s1));
system("pause");
char a[]= "AAA";
scanf("%[^0-9]",a);
printf("%s",a);
scanf("%[^0-9]",a);
printf("%s",a);
scanf("%[^0-9]",a);
printf("%s",a);
system("pause");
return 0;
}