Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
575B

  1. #include<cassert>
  2. #include<iostream>
  3. #include"Array.hh"
  4. #include"DLL.hh"
  5. #include"Zufall.cc"
  6. int main () {
  7. Zufall z(87124);
  8. Array<int> a(5);
  9. DLList<int> l;
  10. // Erzeuge Array und Liste mit 5 Zufallszahlen
  11. for (int i=0; i<5; i=i+1) a[i] = z.ziehe_zahl();
  12. for (int i=0; i<5; i=i+1)
  13. l.insert(l.end(), z.ziehe_zahl());
  14. // Benutzung
  15. for (Array<int>::Iterator i=a.begin();
  16. i!=a.end(); i++)
  17. std::cout << *i << std::endl;
  18. std::cout << std::endl;
  19. for (DLList<int>::Iterator i=l.begin();
  20. i!=l.end(); i++)
  21. std::cout << *i << std::endl;
  22. }