Advertisement
a53

prescurtat

a53
Mar 27th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. void Prescurtat(char s[])
  2. { char con[100]="",*p;
  3. p=strtok(s," ");
  4. while(p)
  5. {
  6. unsigned int lp=strlen(p);
  7. if(p[lp-1]=='.')
  8. { if(p[0]=='C')
  9. strcat(con,"COLEGIUL ");
  10. else
  11. if(p[0]=='L')
  12. strcat(con,"LICEUL ");
  13. else
  14. if(p[0]=='N')
  15. strcat(con,"NATIONAL ");
  16. else
  17. if(p[0]=='T')
  18. strcat(con,"TEORETIC ");
  19. }
  20. else
  21. {
  22. strcat(con,p);
  23. strcat(con," ");
  24. }
  25. p=strtok(NULL," ");
  26. }
  27. while(con[strlen(con)-1]==' ')
  28. con[strlen(con)-1]='\0';
  29. strcpy(s,con);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement