-1
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <assert.h>
typedef struct{
int id;
char nome[20];
char telefone[9];
}tipoCliente;
int main(){
int n,q,i,j,cont;
printf("Qtds:\n");
scanf("%d %d",&n,&q);
tipoCliente cliente[n];
for(i = 0; i < n; i++){
scanf("%d %s %s",&cliente[i].id,&cliente[i].nome,&cliente[i].telefone);
}
printf("\n");
for(i = 0; i < n; i++){
printf("%d %s %s\n",cliente[i].id,cliente[i].nome,cliente[i].telefone);
}
for(i = 0; i < n; i++){
j = atoi(cliente[i].telefone);
cont = strlen(cliente[i].telefone);
char* token = strtok(cliente[i].telefone,"-");
while(token != NULL){
printf("%s\n",token);
token = strtok(NULL,"-");
}
printf("\n");
}
return 0;
}
What do you mean? Give an example to understand what is supposed to be done...
– João Rodrigues JR