Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- char s[100], r[2][100][100];
- int main() {
- int n, ok[2] = {}, k = 0, len[2] = {};
- cin >> n;
- cin.get();
- cin.getline(s, 100);
- char *p = strtok(s, " ");
- while (p) {
- int cond = (strlen(p) >= n);
- strcpy(r[cond][len[cond]++], p);
- ok[cond] = 1;
- p = strtok(NULL, " ");
- }
- if (ok[0] && ok[1])
- for (int i = 1; i >= 0; i--)
- for (int j = 0; j < len[0]; j++)
- puts(r[i][j]);
- else
- puts("nu exista");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement