Advertisement
Guest User

A - nie pelne

a guest
Jan 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string>
  7. using namespace std;
  8.  
  9.  
  10. struct Wynik
  11. {
  12. string miejsce;
  13. double czas;
  14. Wynik* next; // wskaznik na n a s t e p n y wynik
  15. };
  16.  
  17. struct Zawodnik
  18. {
  19. string imie, nazwisko;
  20. Wynik* wyniki; // wskaznik na dr z ewo wynikow
  21. Zawodnik* lewy;
  22. Zawodnik* prawy;// l ewy i prawy potomek w d r z ewi e
  23. };
  24.  
  25. int main()
  26. {
  27. return 0;
  28. }
  29.  
  30.  
  31. Zawodnik* Znajdz(string &imieZ, string &nazwiskoZ, Zawodnik* pRoot)
  32. {
  33. if (!pRoot)
  34. {
  35. pRoot = new Zawodnik{ imieZ,nazwiskoZ, 0, 0, 0};
  36. return pRoot;
  37. }
  38. else
  39. {
  40. if (pRoot->imie == imieZ && pRoot->nazwisko == nazwiskoZ)
  41. {
  42. return pRoot;
  43. }
  44. else if (pRoot->imie > imieZ)
  45. {
  46. Znajdz(imieZ, nazwiskoZ, pRoot->lewy);
  47. }
  48. else
  49. {
  50. Znajdz(imieZ, nazwiskoZ, pRoot->prawy);
  51. }
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement