Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <clocale>
- #include <stdio.h>
- #include <ctime>
- #include <conio.h>
- #include <string>
- #include <Windows.h>
- #include <iomanip>
- #include <cstdio>
- using namespace std;
- void lust(char text[], char** word, char* slova[], int& t);
- int main()
- {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- const int SIZE = 10;
- setlocale(LC_ALL, "Russian");
- const int strok = 10;
- const int dlina = 80;
- int myString; // для ввода кол ва строк
- int counter1 = 0;
- int counter2 = 0;
- char text[strok][dlina+1];
- do
- {
- cout << "Введите количество строк от 2 до " << strok << ": ";
- cin >> myString;
- } while (myString < 2 || myString > strok);
- cout << endl << "Введите текст (Длина строки до " << dlina << " символов): ";
- for (int i = 0; i <= myString; i++)
- gets_s(text[i]);
- char* slova[strok * dlina]{ 0 };
- char* posled[strok * dlina]{ 0 };
- char* p = *text;
- char a[] = { 'a', 'e', 'i', 'o', 'u' };
- int t = 0;
- for (int i = 0; i < strok; i++)
- lust(text[i], &p, slova, t);
- cout << endl << endl;
- //for (int i = 0; i < strok; i++)
- //for (int j = i + 1; j < b; j++) - это я типо уже пытался сделать сравнение с массивом гласных буковок
- //if (strcmp(slova[i]) == a[i])
- cin.get();
- cin.get();
- return 0;
- }
- void lust(char text[], char** word, char* slova[], int& t)
- {
- char* posl = strtok_s(text, " ,-", word);
- while (posl != NULL)
- {
- slova[t] = posl;
- t++;
- posl = strtok_s(NULL, " ,-", word);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement