Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Sroubky_A_Maticky
- {
- public struct CoKamPasuje
- {
- public int Co;
- public int Kam;
- }
- public List<CoKamPasuje> Tabulka = new List<CoKamPasuje>();
- private List<int> Sroubky = new List<int>();
- private Hashtable Maticky;
- public Sroubky_A_Maticky(List<int> Sroubky, List<int> Maticky)
- {
- this.Sroubky = Sroubky;
- this.Maticky = new Hashtable(Maticky.Count);
- for (int i = 0; i < Maticky.Count; i++)
- this.Maticky.Add(Maticky[i], i);
- }
- public void NajdiOdpovidajiciDvojice()
- {
- for (int i = 0; i < Sroubky.Count; i++)
- if (Maticky.ContainsKey(Sroubky[i]))
- {
- CoKamPasuje JedenVyskyt;
- JedenVyskyt.Co = i;
- JedenVyskyt.Kam = (int)Maticky[Sroubky[i]];
- Tabulka.Add(JedenVyskyt);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment