Advertisement
Guest User

Untitled

a guest
May 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. #include <cstdlib>
  4. static const char tabelka[] =
  5. "abcdefghijklmnopqrstuvwxyz";
  6.  
  7. int stringLength = sizeof(tabelka) - 1;
  8.  
  9.  
  10. char randomowa_literka(){
  11. return tabelka[rand() % stringLength];
  12. }
  13.  
  14. int main()
  15. {
  16.  
  17.  srand(time(0));
  18.  std::string Str;
  19.     for(unsigned int i = 0; i < 10; ++i)
  20.     {
  21.  
  22.  
  23.         Str +=randomowa_literka();
  24.         std::cout << Str;
  25.     }
  26.      if (Str['c']>Str['a'])
  27.      {
  28.         std::cout<<"elo"<<std::endl;
  29.     }
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement