Created
October 22, 2019 17:49
-
-
Save parzibyte/a9acdebcb891a0e3640193c6224cfb59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int tieneUnicamenteLetrasDelAlfabeto(char cadena[]) { | |
int i = 0; | |
while (cadena[i]) { | |
// Si no es del alfabeto y no es un espacio regresamos false o 0 | |
if ( | |
!isalpha(cadena[i]) | |
&& cadena[i] != ' '// El espacio cuenta como válido, si no, simplemente quita la condición | |
) | |
return 0; | |
i++; | |
} | |
// Si terminamos de recorrer la cadena y no encontramos errores, regresamos 1 o true | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment