We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5fa48b commit 2672799Copy full SHA for 2672799
Provas/1º Exame/Modelo - C/1241.c
@@ -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
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
0 commit comments