fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. public static string GetPass(int x)
  8. {
  9. string str = "";
  10. Random random = new Random();
  11. while (str.Length < x)
  12. {
  13. /* This is the range for ASCII
  14.   So converting from an int to a char will return a valid ASCII character
  15.   */
  16. char c = (char) random.Next(33, 125);
  17. if (char.IsLetterOrDigit(c))
  18. str += c;
  19. }
  20. return str;
  21. }
  22.  
  23. var password = GetPassword(new Random(20, 30))
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(7,2): error CS1525: Unexpected symbol `public'
prog.cs(7,30): error CS1525: Unexpected symbol `('
prog.cs(24,2): error CS1519: Unexpected symbol `}' in class, struct, or interface member declaration
prog.cs(25,0): error CS1525: Unexpected symbol `}', expecting `,' or `;'
Compilation failed: 4 error(s), 0 warnings
stdout
Standard output is empty