Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Passwords
- {
- class Program
- {
- static void Main(string[] args)
- {
- int desiredSum = int.Parse(Console.ReadLine());
- int codesWanted = int.Parse(Console.ReadLine());
- int currentlyFoundCodes = 0;
- for (int i = 0; i <= 9; i++)
- {
- for (int o = 0; o <= 9; o++)
- {
- for (int p = 0; p <= 9; p++)
- {
- for (int q = 'a'; q <= 'z'; q++)
- {
- for (int z = 'a'; z <= 'z'; z++)
- {
- for (int m = 0; m <= 9; m++)
- {
- if (i + o + p + q + z + m == desiredSum && currentlyFoundCodes < codesWanted)
- {
- currentlyFoundCodes++;
- Console.Write(i);
- Console.Write(o);
- Console.Write(p);
- Console.Write((char)q);
- Console.Write((char)z);
- Console.Write(m);
- Console.Write(" ");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement