Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstring>
- void Prescurtat(char s[])
- {
- int reminder = 0, i, x, j = 0;
- char C[] = "COLEGIUL NATIONAL LICEUL TEORETIC", aux[102];
- for(i = 0; s[i] != '\0'; ++i)
- {
- if(s[i] == '.' && isalpha(s[i - 1]))
- {
- if(strchr(C, s[reminder]))
- {
- char *left = strchr(C, s[i - 1]);
- for(x = 1; left[x] !=' '; ++x)
- aux[j++] = left[x];
- reminder = i + 2;
- }
- }
- else
- aux[j++] = s[i];
- }
- aux[j] = '\0';
- for(i = 0; aux[i] != '\0' ; ++i)
- s[i] = aux[i];
- s[j] = '\0';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement