Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- int i;
- char firstName[50],secondName[50],thirdName[50];
- printf("Entre com o primeiro nome :\n");
- gets(firstName);
- printf("Entre com o segundo nome :\n");
- gets(secondName);
- printf("Entre com o terceiro nome :\n");
- gets(thirdName);
- if (strcmp(firstName,secondName) < 0 && strcmp(firstName,thirdName) < 0)
- printf("'%s', eh o primeiro, alfabeticamente!\n",firstName);
- else if (strcmp(secondName,firstName) < 0 && strcmp(secondName,thirdName))
- printf("'%s', eh o primeiro, alfabeticamente!\n",secondName);
- else if (strcmp(thirdName,secondName) < 0 && strcmp(thirdName,firstName))
- printf("'%s', eh o primeiro, alfabeticamente!\n",thirdName);
- else
- printf("Os tres nomes sao identicos!\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment