Skip to content

Commit 2672799

Browse files
authored
Update and rename 1549.c to 1241.c
1 parent f5fa48b commit 2672799

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

Provas/1º Exame/Modelo - C/1241.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <stdio.h>
2+
#include <string.h>
3+
#define max 1000
4+
5+
int encaixa(const char *s1, const char *s2){
6+
int i,tam1,tam2,verifica=0;
7+
tam1=strlen(s1);
8+
tam2=strlen(s2);
9+
10+
if(tam2 > tam1)
11+
return 0;
12+
else{
13+
for(i=0;i<tam2;i++){
14+
if ( s1[tam1-tam2+i] != s2[i] )
15+
return 0;
16+
}
17+
return 1;
18+
}
19+
}
20+
21+
int main(){
22+
char s1[max],s2[max],tam1,tam2;
23+
int n,i,j;
24+
25+
scanf("%d",&n);
26+
for(i=0;i<n;i++){
27+
scanf("%s %s",s1,s2);
28+
if ( encaixa(s1,s2) )
29+
printf("encaixa\n");
30+
else
31+
printf("nao encaixa\n");
32+
}
33+
}

Provas/1º Exame/Modelo - C/1549.c

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)