Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- class stroka{
- public: int str();
- };
- stroka::str(){
- char s[256];
- int i,j,n;
- printf("Enter string: ");
- gets(s);
- n=0;
- for(i=0;s[i]!=0;i++)
- {
- if (s[i]==' ')
- n++;
- if (n%2==0)
- {
- for (j=i+1; s[j]!=' '; j++);
- i=j; n++;
- }
- else
- printf("%c", s[i]);
- }
- printf("\n");
- }
- main()
- { stroka q;
- q.str();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement