Skip to content

Instantly share code, notes, and snippets.

@MauricioDinki
Created August 31, 2016 02:14
Show Gist options
  • Save MauricioDinki/6effcea02b0953439b05c0c6b135cd68 to your computer and use it in GitHub Desktop.
Save MauricioDinki/6effcea02b0953439b05c0c6b135cd68 to your computer and use it in GitHub Desktop.
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
// Atraves de la tecnica de la burbuja
int main(int argc, char const *argv[]) {
char busqueda[30];
printf("Ingresa la palabra a buscar \n");
scanf("%s", &busqueda);
printf("---------------------- \n");
char nombres[6][30] = {
"Puyol", "Kaka", "Roberto Carlos", "Cristiano", "Messi", "Villa"
};
for (int i = 0; i < 6; i++) {
printf("%s \n", busqueda);
printf("%s \n", nombres[i] );
if (strcmp(busqueda,nombres[i]) == 0) {
printf("Si lo encontre \n");
} else {
printf("No lo encontre \n");
}
printf("-------------------------- \n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment