Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- char * usunspacje(char * tekst)
- {
- int pozycja;
- if( tekst[0]=='\0' )
- return tekst;
- while( tekst[pozycja]!='\0' )
- {
- if( tekst[pozycja]==' ')
- strcpy( &tekst[pozycja], &tekst[pozycja+1]);
- else pozycja ++;
- }
- return tekst;
- }
- int main()
- {
- char tekst[100];
- cout << "Podaj zdanie: " << endl;
- cin >> tekst;
- usunspacje(tekst);
- cout << tekst;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement