Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void SetPoint(char *,int,int);
- int main()
- {
- char string[255];
- printf("Digite os comandos separados por ','\n# ");
- fgets(string,255,stdin);
- SetPoint(string,0,1);
- return 0;
- }
- void SetPoint(char *comandos,int indice,int palavra)
- {
- if(!indice && comandos[1] !='\0')
- {
- printf("Comando: %d ",palavra);
- palavra++;
- }
- else if( comandos[indice] == '\0' )
- {
- return;
- }
- if( comandos[indice] != ',' )
- {
- putchar(comandos[indice]);
- SetPoint(comandos,indice+1,palavra);
- }
- else
- {
- printf("\nComando: %d ",palavra);
- indice++;
- palavra++;
- SetPoint(comandos,indice,palavra);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement