Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- signed main() {
- int n;
- cin >> n;
- vector<int> arr(n);
- vector<vector<int>> ans(n);
- for (int &nr : arr) {
- cin >> nr;
- }
- for (int i = 0; i < n; i++) {
- ans[i] = arr;
- rotate(rbegin(arr), rbegin(arr) + 1, rend(arr));
- }
- for (const auto &line : ans) {
- for (int nr : line) {
- cout << nr << ' ';
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement