Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. void Prescurtat(char s[])
  2. {
  3. char t[150],copie[108]={NULL};
  4. char *p,*z;
  5. p=strtok(s," ");
  6. while(p)
  7. {
  8. int o=strlen(p)-1;
  9. if(p[o]=='.')
  10. {
  11. strcpy(t, p + o + 1);
  12. strcpy(p + o, t);
  13. if(strstr("COLEGIUL",p)!=NULL)
  14. {
  15. strcat(copie,"COLEGIUL ");
  16.  
  17. }
  18. else if(strstr("LICEUL",p)!=NULL)
  19. {
  20. strcat(copie,"LICEUL ");
  21.  
  22. }
  23. else if(strstr("NATIONAL",p)!=NULL)
  24. {
  25. strcat(copie,"NATIONAL ");
  26. }
  27. else if(strstr("TEORETIC",p)!=NULL)
  28. {
  29. strcat(copie,"TEORETIC ");
  30. }
  31. }
  32. else
  33. {
  34. strcat(copie,p);
  35. strcat(copie," ");
  36. }
  37. p=strtok(NULL," ");
  38.  
  39.  
  40. }
  41.  
  42. strcpy(s,copie);
  43. strcpy(t, s + strlen(s));
  44. strcpy(s + strlen(s)-1, t);
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement