Advertisement
Guest User

Untitled

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