-
-
Save anonymous/2d7d608a43bef97d6b23 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
char letra_1[] = "AAAAA"; | |
char letra_2[] = "BBBBB"; | |
char letra_3[] = "CCCCC"; | |
char carac; | |
printf("A: %s\nB: %s\nC: %s\n\n", letra_1, letra_2, letra_3); | |
printf("Ingrese a letra D 5 veces: "); | |
fgets(letra_2, 6, stdin); | |
if (letra_2[strlen(letra_2)-1] == '\n') | |
{ | |
letra_2[strlen(letra_2)-1] = '\0'; | |
} | |
while ((carac = getchar()) != '\n' && carac != EOF); | |
printf("Ingrese la letra E 5 veces: "); | |
fgets(letra_3, 6, stdin); | |
if (letra_3[strlen(letra_3)-1] == '\n') | |
{ | |
letra_3[strlen(letra_3)-1] = '\0'; | |
} | |
while ((carac = getchar()) != '\n' && carac != EOF); | |
printf("\nA: %s\nB: %s\nC: %s\n\n", letra_1, letra_2, letra_3); | |
system("pause"); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment