add
This commit is contained in:
1 parent
bd49911eca
commit
e3de01bde8
3742 files changed
+64316
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t[i],m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 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;
|
||||
}
|
||||
@@ -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, 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;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 1){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int n = strlen(t)
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
int naive(char *m, char *t){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if (strncmp(t, m, lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
t++;
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <stdio.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;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 1){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if (strncmp(t, m, lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
while(i < lt){
|
||||
strncmp(t,m,3)
|
||||
}
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include <stdio.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(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <stdio.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"
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include <stdio.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"
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int 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;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if (strncmp(t, m, lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
else{
|
||||
i++;
|
||||
t++;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":1,"resource":"file:///home/jvj/TP_Info/tp05/Tp5.c","entries":[{"id":"soEi.c","timestamp":1726227041808},{"id":"fXaW.c","timestamp":1726227072810},{"id":"BVDo.c","timestamp":1726227124800},{"id":"AipY.c","timestamp":1726227240159},{"id":"a7XJ.c","timestamp":1726227313126},{"id":"T6no.c","timestamp":1726227713453},{"id":"VShH.c","timestamp":1726227785555},{"id":"Y1d9.c","timestamp":1726227846093},{"id":"XyBn.c","timestamp":1726227863358},{"id":"FU7b.c","timestamp":1726227920062},{"id":"edup.c","timestamp":1726228057875},{"id":"u5mM.c","timestamp":1726228111630},{"id":"75d1.c","timestamp":1726228122290},{"id":"Y49q.c","timestamp":1726228153001},{"id":"5bX4.c","timestamp":1726228348748},{"id":"n0Dz.c","timestamp":1726228544578},{"id":"Mpem.c","timestamp":1726228596047},{"id":"ufxw.c","timestamp":1726228608416},{"id":"9F7u.c","timestamp":1726228642249},{"id":"pAqw.c","timestamp":1726229104890},{"id":"0wRy.c","timestamp":1726229156147},{"id":"9ty1.c","timestamp":1726229180499},{"id":"sYDE.c","timestamp":1726229208888},{"id":"qKVt.c","timestamp":1726229233143},{"id":"wobu.c","timestamp":1726229259666},{"id":"zBl6.c","timestamp":1726229307678},{"id":"RNBD.c","timestamp":1726229340464},{"id":"Ea3r.c","timestamp":1726229429060},{"id":"cRZL.c","timestamp":1726229595215},{"id":"pwFH.c","timestamp":1726229621920}]}
|
||||
@@ -0,0 +1,11 @@
|
||||
int naive(char *m, char *t){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;ê
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 1){
|
||||
res += 1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if (strncmp(t, m, lm) == 0){
|
||||
res += 1;
|
||||
i+= lm;
|
||||
t+= lm;
|
||||
}
|
||||
else{
|
||||
i++;
|
||||
t++;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
const char* tc = t[i];
|
||||
if(strncmp(tc,m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
char tc = t[i];
|
||||
if(strncmp(tc,m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
int naive(char *m, char *t){
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
if(strncmp(t,m,lm) == 1){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
char* tc = t[i];
|
||||
if (strncmp(tc,m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int naive(char *m, char *t){
|
||||
int lt = strlen(t);
|
||||
int lm = strlen(m);
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
while(i < lt){
|
||||
char* tc = t+1;
|
||||
if (strncmp(tc,m,lm) == 0){
|
||||
res += 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char* text = "blabablabalablaba" ;
|
||||
char* mot = "bla";
|
||||
int oc = 0;
|
||||
oc = naive(mot, text);
|
||||
printf("il y en a : %d\n", oc);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user