Advertisement
VladSmirN

1

Feb 7th, 2022
1,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1.         public bool check_combinations()
  2.         {
  3.  
  4.             HashSet<string> groups_hs = new HashSet<string>();
  5.             int number_combinations = 0;
  6.             for (int i = 0; i < this.groups.Count; ++i)
  7.                 for (int j = 0; j < i; ++j)
  8.                     for (int k = 0; k < j; ++k)
  9.                             number_combinations += this.phrases[this.groups[i]].Count * this.phrases[this.groups[j]].Count * this.phrases[this.groups[k]].Count;
  10.  
  11.             Console.WriteLine("Возможных комбинаций:"+ number_combinations);
  12.  
  13.             if (number_combinations >= this.number_name)
  14.                 return true;
  15.             else
  16.             {
  17.                 Console.WriteLine("Возможных комбинаций меньше чем имен");
  18.                 return false;
  19.             }
  20.                
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement