Advertisement
nikita_yashin

MaxNum

Feb 28th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public int MaxNum()
  2. {
  3. int max = 0;
  4. int temp = 0;
  5. var prev = Temp;
  6. var el = Temp;
  7. while (el != null)
  8. {
  9. if (el.Info == prev.Info)
  10. temp++;
  11. else
  12. {
  13. prev = el;
  14. temp = 1;
  15. }
  16. if (temp > max) max = temp;
  17. el = el.Prev;
  18. }
  19. return max;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement