Advertisement
Guest User

Untitled

a guest
Jan 14th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <clocale>
  4. #include <stdio.h>
  5. #include <ctime>
  6. #include <conio.h>
  7. #include <string>
  8. #include <Windows.h>
  9. #include <iomanip>
  10. #include <cstdio>
  11. using namespace std;
  12.  
  13. void lust(char text[], char** word, char* slova[], int& t);
  14.  
  15. int main()
  16. {
  17. SetConsoleCP(1251);
  18. SetConsoleOutputCP(1251);
  19. const int SIZE = 10;
  20. setlocale(LC_ALL, "Russian");
  21. const int strok = 10;
  22. const int dlina = 80;
  23. int myString; // для ввода кол ва строк
  24. int counter1 = 0;
  25. int counter2 = 0;
  26. char text[strok][dlina+1];
  27. do
  28. {
  29. cout << "Введите количество строк от 2 до " << strok << ": ";
  30. cin >> myString;
  31. } while (myString < 2 || myString > strok);
  32. cout << endl << "Введите текст (Длина строки до " << dlina << " символов): ";
  33. for (int i = 0; i <= myString; i++)
  34. gets_s(text[i]);
  35.  
  36. char* slova[strok * dlina]{ 0 };
  37. char* posled[strok * dlina]{ 0 };
  38. char* p = *text;
  39. char a[] = { 'a', 'e', 'i', 'o', 'u' };
  40. int t = 0;
  41.  
  42. for (int i = 0; i < strok; i++)
  43. lust(text[i], &p, slova, t);
  44. cout << endl << endl;
  45.  
  46. //for (int i = 0; i < strok; i++)
  47. //for (int j = i + 1; j < b; j++) - это я типо уже пытался сделать сравнение с массивом гласных буковок
  48. //if (strcmp(slova[i]) == a[i])
  49.  
  50.  
  51.  
  52. cin.get();
  53. cin.get();
  54.  
  55. return 0;
  56.  
  57. }
  58.  
  59. void lust(char text[], char** word, char* slova[], int& t)
  60. {
  61. char* posl = strtok_s(text, " ,-", word);
  62. while (posl != NULL)
  63. {
  64. slova[t] = posl;
  65. t++;
  66. posl = strtok_s(NULL, " ,-", word);
  67. }
  68. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement