Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Prescurtat(char s[])
- {
- int i,ad, j, n = strlen(s) - 1;
- char t[200];
- for(i = 0; i <= n; ++i)
- {
- if((i == 0 || (s[i - 1] == ' ')) && strchr("CLNT", s[i]))
- {
- j = i;
- while(s[j] != ' ' && j <= n)
- ++j;
- if(s[j - 1] == '.' || (j > n && s[n] == '.'))
- {if(s[i] == 'C')
- strcpy(t,"COLEGIUL");
- else
- if(s[i] == 'L')
- strcpy(t,"LICEUL");
- else
- if(s[i] == 'N')
- strcpy(t, "NATIONAL");
- else
- strcpy(t, "TEORETIC");
- strcpy(t + strlen(t), s + j);
- strcpy(s + i, t);
- n += strlen(t);
- }
- }
- }
- j = strlen(s) - 1;
- if(s[j] == '.')
- {
- while(s[j] != ' ')
- j--;
- j++;
- // cout<<s[j]<<'\n';
- if(s[j] == 'C')
- strcpy(t,"COLEGIUL");
- else
- if(s[j] == 'L')
- strcpy(t,"LICEUL");
- else
- if(s[j] == 'N')
- strcpy(t, "NATIONAL");
- else
- strcpy(t, "TEORETIC");
- strcpy(s + j, t);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement