Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- const int N{ 50 };
- std::string wygeneruj(int dlugosc) {
- std::string wynik{};
- for (auto i{ 0 }; i < dlugosc; ++i) {
- wynik += ('A' + rand() % 6);
- }
- return wynik;
- }
- void wypiszWyrazy() {
- int dlugosc;
- std::cout << "Podaj dlugosc wyrazu: ";
- std::cin >> dlugosc;
- for (auto i{ 0 }; i < N; ++i) {
- std::cout << wygeneruj(dlugosc) << std::endl;
- }
- }
- int main() {
- srand(time(nullptr));
- wypiszWyrazy();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment