Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <string>
- //#include <cmath>
- //#include <climits>
- //#include <algorithm>
- using namespace std;
- int main() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- string s, temp_s;
- getline(cin, s);
- int length = s.length(), k = 0;
- string *arr = new string[length];
- if (!isspace(s[length - 1]))
- s += " ";
- for (char c : s) {
- if (isalpha(c) || isdigit(c)) {
- c = tolower(c);
- temp_s += c;
- }
- if (isspace(c)) {
- if (temp_s.length() > 3) {
- arr[k++] = temp_s;
- }
- temp_s = "";
- }
- }
- for (int i = 0; i < k; i++) {
- if (i != k - 1)
- cout << arr[i] << " ";
- else
- cout << arr[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement