Advertisement
Josif_tepe

Untitled

Dec 15th, 2022
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main() {
  6.     int n, k;
  7.     scanf("%d%d", &n, &k);
  8.     int niza[n];
  9.     for(int i = 0; i < n; i++) {
  10.         scanf("%d", &niza[i]);
  11.     }
  12.     int a[n];
  13.     int indeks = 0;
  14.     for(int i = k; i < n; i++) {
  15.         a[indeks] = niza[i];
  16.         indeks++;
  17.     }
  18.     for(int i = 0; i < k; i++) {
  19.         a[indeks] = niza[i];
  20.         indeks++;
  21.     }
  22.     for(int i = 0; i < n; i++) {
  23.         printf("%d ", a[i]);
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement