fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace pASS4
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. string pw;
  15.  
  16. int convertedPw;
  17. int counter = 0;
  18. int uLetters = 0;
  19. int lLetters = 0;
  20. int numbers = 0;
  21. int symbols = 0;
  22.  
  23.  
  24. Begin:
  25. Console.WriteLine("Enter a Password");
  26. pw = Console.ReadLine();
  27.  
  28. // #### >BEGIN< PROCESSING EACH CHARACTER ####
  29. CharEnumerator charEnum = pw.GetEnumerator();
  30. while (charEnum.MoveNext())
  31. {
  32. convertedPw = Convert.ToInt32(pw[counter]);
  33.  
  34. if ((convertedPw >= 65) && (convertedPw <= 90))
  35. {
  36. uLetters++;
  37. }
  38.  
  39. if ((convertedPw >= 97) && (convertedPw <= 122))
  40. {
  41. lLetters++;
  42. }
  43.  
  44. if ((convertedPw >= 48) && (convertedPw <= 57))
  45. {
  46. numbers++;
  47. }
  48.  
  49. if ((convertedPw >= 33) && (convertedPw <= 47))
  50. {
  51. symbols++;
  52. }
  53.  
  54. if ((convertedPw >= 58) && (convertedPw <= 64))
  55. {
  56. symbols++;
  57. }
  58.  
  59. if ((convertedPw >= 91) && (convertedPw <= 96))
  60. {
  61. symbols++;
  62. }
  63.  
  64.  
  65. if ((convertedPw >= 123) && (convertedPw <= 126))
  66. {
  67. symbols++;
  68. }
  69.  
  70. counter++;
  71. }
  72. // #### >END< PROCESSING EACH CHARACTER ####
  73.  
  74. // INTERPRETE ANALYSIS RESULT
  75.  
  76. if ((counter >= 8) && (uLetters >= 1) && (lLetters >= 1) && (numbers >= 1) && (symbols >= 1))
  77. {
  78. Console.WriteLine("The Password is Secure!!!");
  79. }
  80. if (counter < 8)
  81. {
  82. Console.WriteLine("The Password Must be up to 8 Characters");
  83. goto Begin;
  84. }
  85. if (uLetters == 0)
  86. {
  87. Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Upper Case Character");
  88. goto Begin;
  89. }
  90. if (lLetters == 0)
  91. {
  92. Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Lower Case Character");
  93. goto Begin;
  94. }
  95. if (numbers == 0)
  96. {
  97. Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Number");
  98. goto Begin;
  99. }
  100. if (symbols == 0)
  101. {
  102. Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Symbol");
  103. goto Begin;
  104. }
  105.  
  106.  
  107. Console.ReadLine();
  108.  
  109. }
  110. }
  111. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty