Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 8, 2021 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/bd9b7ed1f359d024bd77749925700eb8 to your computer and use it in GitHub Desktop.
Save parzibyte/bd9b7ed1f359d024bd77749925700eb8 to your computer and use it in GitHub Desktop.
int buscarFila(char matriz[LONGITUD][LONGITUD], char busqueda)
{
int y;
for (y = 0; y < LONGITUD; y++)
{
int x;
for (x = 0; x < LONGITUD; x++)
{
char actual = matriz[y][x];
if (actual == busqueda)
{
return y;
}
}
}
return -1;
}
int buscarColumna(char matriz[LONGITUD][LONGITUD], char busqueda)
{
int y;
for (y = 0; y < LONGITUD; y++)
{
int x;
for (x = 0; x < LONGITUD; x++)
{
char actual = matriz[y][x];
if (actual == busqueda)
{
return x;
}
}
}
return -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment