Advertisement
golfflower

lab9

Feb 17th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include <iostream> //библиотека с простыми манипуляторами
  2. #include <iomanip> //библиотека с параметризированными манипуляторами
  3.  
  4. using namespace std; //подключение пространства имён
  5.  
  6. const int n=10, m=80, b=20;
  7.  
  8. int masinput(char **mas, int n)
  9. {
  10. cout<<"Введите текст"<<endl;
  11. int w=0;
  12. while (w<n)
  13. {
  14. cin.getline(mas[w],m);
  15. if ((strcmp(mas[w],"")==0)) break;
  16. w++;
  17. }
  18. if ((strcmp(mas[w],"")==0))
  19. return w+1;
  20. }
  21.  
  22. int wordsearch(char **mas, int n, int q)
  23. {
  24. cout<<"Введите слово для поиска"<<endl;
  25. char word[b];
  26. cin>>word;
  27.  
  28.  
  29. return 0;
  30. }
  31.  
  32. int main(void) //главная функция
  33. {
  34. //руссификация консоли
  35. setlocale(LC_ALL, "RUSSIAN");
  36. //переменные
  37. char **mas;
  38. mas=new char *[n];
  39. for (int i=0; i<n; i++)
  40. mas[i]=new char [m];
  41. int q=masinput(mas,n);
  42. int e=wordsearch(mas,n,q);
  43. cout<<e<<endl;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement