Escolar Documentos
Profissional Documentos
Cultura Documentos
h>
#include <stdlib.h>
#include <string.h>
if(strcmp(palavra, frase){
return true;
}
for (int i = 0; i <= strlen(frase) - strlen(palavra); i++){
if(frase[i] == palavra[0]){
aux = i;
for (int j = o; j < strlen(palavra); j++){
if (palavra[j) == frase[aux]){
teste[j] = 1;
aux++;
}
}
if(testar(teste, strlen(palavra))){
return true;
}
}
}
return false;
}
int m;
int n;
char alfabeto[] =
{'a','b','c','d','e','f','g','h','i','j','l','m','n','o','p','q','r','s','t','u','v
','x','z'};
printf("informe o tamanho da matriz: ");
scanf("%d", &m);
n = m;
int matriz[m][n];
int r = 0
for(int j = 0; j < m+1; i++)
{
for(int i = 0; i < n+1;i++)
{
matriz[j][i] = alfabeto[r]
r++
}
}
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
return false;
}
for(int k=0;k<strlen(palavra);k++)
teste[k]=0;
aux=i;
for(int j=0;j<strlen(palavra);j++){
if(palavra[j]==frase[aux]){
teste[j]=1;
aux++;
}
}
ok=true;
for(int m=0;m<strlen(palavra);m++){
if(teste[m]==0){
ok=false;
}
}
if( ok ){
return true;
}
}
}
return false;
}
int main(){
char frase[] = "O carro e azul";
char palavra[] = "l";
if(existe(palavra,frase)){
printf("\n\nA palavra existe\n\n");
}else{
printf("\n\nA palavra nao existe\n\n");
}
system("pause");
return 0;