Advertisement
MeehoweCK

Untitled

May 28th, 2023
775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. void fMaxMin(vector<int*> vec, int* max, int**& min, int** cMax, int& cMin)
  7. {
  8.     // miejsce na kod funkcji
  9. }
  10.  
  11. int main()
  12. {
  13.     auto vec = vector<int>{1, 2, 1, 42, 2, 2, 42, 1, 1, 2, 1, 42};
  14.     auto vecP = vector<int*>();
  15.     for (auto& item : vec)
  16.     {
  17.         vecP.push_back(&item);
  18.     }
  19.  
  20.     int max, min, cMax, cMin;
  21.  
  22.     // miejsce na wywołanie funkcji
  23.  
  24.     cout << "max: " << max << endl;
  25.     cout << "min: " << min << endl;
  26.     cout << "cMax: " << cMax << endl;
  27.     cout << "cMin: " << cMin << endl;
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement