Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <float.h>
- #include <string>
- #include <Windows.h>
- using namespace std;
- void function(char *x, char *y);
- void function(char *x, char *y)
- {
- unsigned int i, j = 0;
- bool C = true;
- for (i = 0; i<strlen(x); i++)
- {
- if (x[i] == ' ')
- C = !C;
- if (C)
- {
- y[j] = x[i];
- j++;
- }
- }
- y[j] = '\0';
- }
- int main()
- {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- char A[50], B[50];
- cout << "Введите строку:\n";
- cin.getline(A, 50);
- function(A, B);
- cout << "Измененная строка::\n";
- cout << B << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement