Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <vector>
  5. #include <fstream>
  6. using namespace std;
  7.  
  8. void GeneretarTrojek(string nazwapliku, int n, int min, int max)
  9. {
  10. cout << nazwapliku << endl;
  11. cout << n << endl;
  12. int liczba1;
  13. int liczba2;
  14. int liczba3;
  15. srand(time(NULL));
  16. liczba1 = rand() % 7 + 2;
  17. liczba2 = rand() % 7 + 2;
  18. liczba3 = rand() % 7 + 2;
  19. for (int i = 1; i <= n; i++)
  20. {
  21. cout << liczba1 << ";" << liczba2 << ";" << liczba3<<endl;
  22. }
  23. }
  24.  
  25. int main()
  26. {
  27. GeneretarTrojek("Trojki", 5, 2, 8);
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement