fork download
  1. using System;
  2.  
  3. namespace FR_05_02_MocHasla
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int iteracja;
  10. iteracja = int.Parse(Console.ReadLine());
  11. for (int i = 0; i < iteracja; i++)
  12. {
  13.  
  14. string haslo = Console.ReadLine();
  15.  
  16. if(haslo.Length >= 8 && Test(haslo))
  17. {
  18.  
  19. Console.WriteLine(haslo);
  20.  
  21.  
  22. }
  23.  
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33. public static bool checkBigLetter(char c)
  34. {
  35. return c >= 'A' && c <= 'Z';
  36. }
  37.  
  38. public static bool checkSmallLetter(char c)
  39. {
  40. return c >= 'a' && c <= 'z';
  41. }
  42.  
  43. public static bool checkNumber(char c)
  44. {
  45. return c >= '0' && c <= '9';
  46. }
  47.  
  48. public static bool checkSpecialChar(char c)
  49. {
  50. if (checkNumber(c) || checkSmallLetter(c) || checkBigLetter(c)) return false;
  51. return true;
  52. }
  53.  
  54. public static bool Test(string zdane)
  55. {
  56. //tutaj nie wiem jak zapisac warunki w csharpie
  57. bool bigLetter = false, smallLetter = false, number = false, specialChar = false;
  58. for (int i = 0; i < zdane.Length; i++)
  59. {
  60. char c = zdane[i];
  61. bigLetter |= checkBigLetter(c);
  62. smallLetter |= checkSmallLetter(c);
  63. number |= checkNumber(c);
  64. specialChar |= checkSpecialChar(c);
  65. }
  66. return bigLetter && smallLetter && number && specialChar;
  67. }
  68.  
  69.  
  70. }
  71. }
  72.  
Runtime error #stdin #stdout #stderr 0.03s 22700KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Unhandled Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: s
  at System.Int32.Parse (System.String s) [0x00003] in <6649516e5b3542319fb262b421af0adb>:0 
  at FR_05_02_MocHasla.Program.Main (System.String[] args) [0x00005] in <8643f4dde24047599abdb3e5040e31ff>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null.
Parameter name: s
  at System.Int32.Parse (System.String s) [0x00003] in <6649516e5b3542319fb262b421af0adb>:0 
  at FR_05_02_MocHasla.Program.Main (System.String[] args) [0x00005] in <8643f4dde24047599abdb3e5040e31ff>:0