Advertisement
Guest User

Random

a guest
Feb 19th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RandomStringGenerator
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. //Random
  10. //strings between a-z A-Z 0-9
  11. //no input only output
  12. // 10 symbols length
  13.  
  14. Random rand = new Random();
  15. for (int i = 0; i < 10; i++)
  16. {
  17. int n = rand.Next(48, 122);
  18.  
  19. if ((n>= 58 && n <= 64) || (n >= 91 && n <= 96))
  20. {
  21. if (i != 0)
  22. {
  23. i -= 1;
  24. continue;
  25. }
  26. else
  27. {
  28. i = 0;
  29. continue;
  30. }
  31.  
  32. }
  33. Console.Write((char)n);
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement