add
This commit is contained in:
1 parent
bd49911eca
commit
e3de01bde8
3742 files changed
+64316
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i, res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,3) == 1){
|
||||
res += 1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char text[17] = "blabablabalablaba" ;
|
||||
char mot[3] = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user