Advertisement
MeehoweCK

Untitled

Feb 16th, 2024
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. short int znajdz_nastepna_wieksza(const std::vector<short int>& ciag, const short int& k) {    
  2.     auto size{ ciag.size() };
  3.     auto pozycja{ k + 1 };
  4.     for (auto i{ k + 2 }; i < size; ++i) {
  5.         if (ciag[i] > ciag[k] && ciag[i] < ciag[pozycja]) {
  6.             pozycja = i;
  7.         }
  8.     }
  9.     return static_cast<short int>(pozycja);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement