fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. void testCase() {
  5. int n; cin >> n;
  6. vector<int> a(n);
  7. for (int &i : a) cin >> i;
  8.  
  9. for (int i = 0; i < n - 1; ++i) {
  10. for (int j = i + 1; j < n; ++j) {
  11. if (a[j] < a[i])
  12. swap(a[i], a[j]);
  13. }
  14.  
  15. cout << "Buoc " + to_string(i + 1) + ": ";
  16. for (int j = 0; j < n; ++j) {
  17. cout << a[j] << " ";
  18. }
  19. cout << endl;
  20. }
  21. }
  22.  
  23. int main() {
  24. ios_base::sync_with_stdio(false);
  25. cin.tie(NULL); cout.tie(NULL);
  26.  
  27. int T = 1;
  28. while (T--) {
  29. testCase();
  30. cout << "\n";
  31. }
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout