Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char text[256],text1[256],*p,p1[256],t[256]="",separator[]=",. !? ";
- int i,x,n;
- cin.get(text,256);
- strcpy(text1,text);
- p=strtok(text,separator); ///primul apel(cuvant)
- while (p!=NULL){ ///atat timp cat mai exista entitati(cuvinte)
- x=p-text;
- n=strlen(p);
- strcpy(p1,p);
- if(n==3) strcat(t,"*");
- else strcat(t,p1);
- i=x+n;
- while(text1[i]==' ' ) {
- strcat(t," ");
- i++;
- }
- p=strtok(NULL,separator); ///urmatorul apel
- }
- cout<<t;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement