Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int n, i, N;
- cout << "N ";
- cin >> N; { char *s = new char[N + 1];
- cout << "string \n";
- cin.getline(s, N);
- n = strlen(s); cout << "\n текст разбит на слова:\n";
- for (i = 0; i < n; i++)
- {
- if (s[i] == ' ') cout << "\n"; else cout << s[i];
- }
- cout << "\n"; }
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment