fork(3) 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 ConsoleApp9
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int n = Convert.ToInt32(Console.ReadLine());
  15.  
  16. string[] hasla = new string[n];
  17. int ileLiter;
  18.  
  19.  
  20. for (int i = 0; i < n; i++)
  21. {
  22. hasla[i] = Console.ReadLine();
  23. }
  24.  
  25. for (int i = 0; i < n; i++)
  26. {
  27. ileLiter = hasla[i].Length;
  28.  
  29. int moc = 0;
  30.  
  31. for (int j = 0; j < ileLiter; j++)
  32. {
  33.  
  34. if (wielkaLitera(hasla[i][j]))
  35. {
  36. moc++;
  37. break;
  38. }
  39. }
  40. for (int j = 0; j < ileLiter; j++)
  41. {
  42. if (malaLitera(hasla[i][j]))
  43. {
  44. moc++;
  45. break;
  46. }
  47. }
  48. for (int j = 0; j < ileLiter; j++)
  49. {
  50. if (cyfra(hasla[i][j]))
  51. {
  52. moc++;
  53. break;
  54. }
  55. }
  56. for (int j = 0; j < ileLiter; j++)
  57. {
  58. if (otherSign(hasla[i][j]))
  59. {
  60. moc++;
  61. break;
  62. }
  63. }
  64.  
  65. if (ileLiter < 8)
  66. {
  67. moc = 0 ;
  68. }
  69. if (moc == 4)
  70. {
  71. Console.WriteLine(hasla[i]);
  72.  
  73. }
  74.  
  75. }
  76.  
  77.  
  78. Console.ReadKey();
  79.  
  80.  
  81.  
  82.  
  83. }
  84. static bool wielkaLitera (char a)
  85. {
  86. if (char.IsUpper(a))
  87. {
  88. return true;
  89. }
  90. return false;
  91. }
  92. static bool malaLitera(char a)
  93. {
  94. if (char.IsLower(a))
  95. {
  96. return true;
  97. }
  98. return false;
  99. }
  100. static bool cyfra(char a)
  101. {
  102. if (char.IsDigit(a))
  103. {
  104. return true;
  105. }
  106. return false;
  107. }
  108. static bool otherSign (char a)
  109. {
  110. if (((!char.IsLetter(a)) && (!char.IsDigit(a))) || char.IsWhiteSpace(a))
  111. {
  112. return true;
  113. }
  114. return false;
  115. }
  116.  
  117. }
  118.  
  119.  
  120. }
  121.  
  122.  
Success #stdin #stdout 0.01s 131520KB
stdin
3
pass1234
P@$$1234
Pa$$1234
stdout
Pa$$1234