Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. int main() {
  5.  
  6. std::string tabprefixy[100];
  7. std::string tabfixy[100];
  8. std::string tabsufixy[100];
  9.  
  10. std::fstream prefixy;
  11. prefixy.open ("prefixy",std::ios::in); // imie
  12. std::fstream fixy;
  13. prefixy.open ("fixy",std::ios::in); // rasa
  14. std::fstream sufixy;
  15. sufixy.open ("sufixy",std::ios::in); // rola
  16.  
  17. std::string napis;
  18. std::string temp;
  19.  
  20. int lp=0;
  21. while( !prefixy.eof() )
  22. {
  23. getline(prefixy,napis);
  24. tabprefixy[lp]=napis;
  25. lp++;
  26. }
  27. prefixy.close();
  28.  
  29. int lf=0;
  30. while( !fixy.eof() )
  31. {
  32. getline(fixy,napis);
  33. tabfixy[lf]=napis;
  34. lf++;
  35. }
  36. fixy.close();
  37.  
  38. int ls=0;
  39. while( !sufixy.eof() )
  40. {
  41. getline(sufixy,napis);
  42. tabsufixy[ls]=napis;
  43. ls++;
  44. }
  45. sufixy.close();
  46.  
  47. srand(time(NULL));
  48. int rp=rand()%lp;
  49. int rf=rand()%lf;
  50. int rs=rand()%ls;
  51.  
  52. std::cout << tabprefixy[rp]; tabfixy[rf]; tabsufixy [rs];
  53.  
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement