Untitled
unknown
plain_text
3 years ago
653 B
8
Indexable
void Prescurtat(char s[]){
char ans[105]="", *p;
p=strtok(s, " ");
while(p){
int size=strlen(p);
if(p[size-1]=='.'){
if(p[0]=='C'){
strcat(ans, "COLEGIUL ");
}
else if(p[0]=='L'){
strcat(ans, "LICEUL ");
}
else if(p[0]=='N'){
strcat(ans, "NATIONAL ");
}
else{
strcat(ans, "TEORETIC ");
}
}
else{
strcat(ans, p);
strcat(ans, " ");
}
p=strtok(NULL, " ");
}
ans[strlen(ans)-1]='\0';
strcpy(s, ans);
}Editor is loading...