Guest User

Untitled

a guest
Mar 20th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main()
  5. {
  6. setlocale(LC_ALL, "Russian");
  7. int n, i, N;
  8. cout << "N ";
  9. cin >> N; { char *s = new char[N + 1];
  10. cout << "string \n";
  11. cin.getline(s, N);
  12. n = strlen(s); cout << "\n текст разбит на слова:\n";
  13. for (i = 0; i < n; i++)
  14. {
  15. if (s[i] == ' ') cout << "\n"; else cout << s[i];
  16. }
  17. cout << "\n"; }
  18. return (0);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment