AlexSSH

Untitled

Oct 1st, 2023
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. // РАЗМЕСТИТЕ ВАШ КОД ЗДЕСЬ
  7.  
  8. void TestCountArrayRotations(std::vector<int> arr, int expectedRotations) {
  9.     std::cout << "Array: ";
  10.     for (auto i: arr) {
  11.         std::cout << i << " ";
  12.     }
  13.     std::cout << " | ";
  14.     int rotations = CountArrayRotations(arr);
  15.     if (rotations == expectedRotations) {
  16.         cout << "Passed" << endl;
  17.     } else {
  18.         cout << "Failed (" << expectedRotations << " != " << rotations << ")" << endl;
  19.     }
  20. }
  21.  
  22. int main() {
  23.     TestCountArrayRotations({1, 1, 8, 0}, 1);
  24.     TestCountArrayRotations({1, 2, 3, 4}, 3);
  25.     return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment