Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. void Prescurtat(char s[])
  2. {
  3. int i,ad, j, n = strlen(s) - 1;
  4. char t[30];
  5. for(i = 0; i <= n; ++i)
  6. {
  7. if(i == 0 || (s[i - 1] == ' ') && strchr("CLNT", s[i]))
  8. {
  9. j = i;
  10. while(s[j] != ' ')
  11. ++j;
  12. if(s[i] == 'C')
  13. strcpy(t,"COLEGIUL");
  14. else
  15. if(s[i] == 'L')
  16. strcpy(t,"LICEUL");
  17. else
  18. if(s[i] == 'N')
  19. strcpy(t, "NATIONAL");
  20. else
  21. strcpy(t, "TEORETIC");
  22.  
  23. strcpy(t + strlen(t), s + j);
  24. strcpy(s + i, t);
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement