fork download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int n, a[103], k;
  6.  
  7. int main(){
  8. cin >> n >> k;
  9. for(int i = 1; i <= n; i++){
  10. cin >> a[i];
  11. }
  12. for(int i = k+1; i <= n; i++){
  13. cout << a[i] << ' ';
  14. }
  15. for(int i = 1; i <= k; i++){
  16. cout << a[i] << ' ';
  17. }
  18. }
  19.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty