Advertisement
Guest User

Шеста

a guest
Dec 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Passwords
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int desiredSum = int.Parse(Console.ReadLine());
  14. int codesWanted = int.Parse(Console.ReadLine());
  15. int currentlyFoundCodes = 0;
  16.  
  17. for (int i = 0; i <= 9; i++)
  18. {
  19. for (int o = 0; o <= 9; o++)
  20. {
  21. for (int p = 0; p <= 9; p++)
  22. {
  23. for (int q = 'a'; q <= 'z'; q++)
  24. {
  25. for (int z = 'a'; z <= 'z'; z++)
  26. {
  27. for (int m = 0; m <= 9; m++)
  28. {
  29. if (i + o + p + q + z + m == desiredSum && currentlyFoundCodes < codesWanted)
  30. {
  31. currentlyFoundCodes++;
  32. Console.Write(i);
  33. Console.Write(o);
  34. Console.Write(p);
  35. Console.Write((char)q);
  36. Console.Write((char)z);
  37. Console.Write(m);
  38. Console.Write(" ");
  39.  
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48.  
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement