Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int Przywodca(int[] tablica)
- {
- int ile = 0;
- int j = 0;
- for (int i = 1; i < tablica.Length; i++)
- {
- if (ile == 0)
- {
- ile += 1;
- j = i;
- }
- else if (tablica[i] == tablica[j])
- {
- ile += 1;
- }
- else
- {
- ile -= 1;
- }
- }
- return tablica[j];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement