Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int length, k, j = 0, i = 0, counter = 0;
- char string[256];
- cout << "vvedite stroky" << endl;
- gets_s(string);
- cout << endl;
- length = strlen(string);
- cout << "dlina stroki=" << length << endl;
- for (i = 0; i < length; ++i)
- {
- cout << string[i];
- }
- for (int i = 0; i < length; ++i)
- {
- if (string[i] != ' ')
- {
- counter++;
- }
- else
- { counter = 0; }
- if (string[i] % 2 == 0 && (string[i + 1] == ' ' || string[i+1]=='\0'))
- {
- for (int k = i - counter +1; k < length - counter; ++k)
- string[k ] = string[k + counter];
- length -= counter;
- }
- }
- cout << endl;
- for (i = 0; i < length; ++i)
- {
- cout << string[i];
- }
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement