Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //receber um nome completo
- //Joao Soares Pereira Siqueira Dias Freitas Silva
- //SILVA/joao
- /*
- ly yan io
- 012345678
- */
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main() {
- char nome[30];
- int tam=0,i=0,pesp=0,uesp=0;
- printf("Informe o nome: ");
- scanf("%[^\n]s",&nome);
- tam = strlen(nome);
- for(i=0;i<tam;i++){
- if(nome[i]==' '){
- uesp = i;
- }
- }
- for(i=tam-1;i>=0;i--){
- if(nome[i]==' '){
- pesp = i;
- }
- }
- for(i=uesp+1;i<tam;i++){
- printf("%c",toupper(nome[i]));
- }
- printf("/");
- for(i=0;i<pesp;i++){
- printf("%c",tolower(nome[i]));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement