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 a[100];
- int i,n;
- cout<<"Introduceti sirul:";
- cin.get(a, 100);
- n=strlen(a);
- for(i=0; i<=n; i++)
- {
- if(a[i+1]==' ' && a[i]==' ')
- {
- strcpy(a+i, a+i+1);
- i--;
- }
- }
- cout<<a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement