Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <utility>
  4. #include <cstdio>
  5.  
  6. using namespace std;
  7. void lomnto (int t[], int n, int p);
  8. int main()
  9. {
  10. int n, k;
  11. scanf("%d %d", &n, &k);
  12. int tab[n];
  13. for (int i=0; i<n; i++)
  14. scanf("%d", tab[i]);
  15.  
  16. int piwot=tab[k-1];
  17. lomnto(tab, n, piwot);
  18.  
  19. for (int i=0; i<n; i++)
  20. printf("%d ", tab[i]);
  21. printf("\n");
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement