fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. string alphabet;
  11. cin >> alphabet;
  12.  
  13. int wordsCount = 9 + rand()%4; // Случайное количество слов
  14. for(int i = 0; i < wordsCount; ++i)
  15. {
  16. int wordLength = 5 + rand()%10; // Случайная длина слова
  17. string word;
  18. for(int j = 0; j < wordLength; ++j)
  19. word += alphabet[rand()%alphabet.length()];
  20. cout << word << endl;
  21. }
  22.  
  23. }
  24.  
Success #stdin #stdout 0s 4576KB
stdin
abcdef
stdout
dbfbeadbcbc
feaaeefcddcccb
bfaaafdbebed
dfcbccfa
ebccdcce
ddcdcf
dbfadadcdcc
cbaaccad
cbaaca
eeaafdecefdfcd
ecbccbd
efeddbdfdfdbde