Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
653 B
1
Indexable
Never
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);
}