Advertisement
mickypinata

SMMR-T055: Beverage

Jun 4th, 2021
1,418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. const int N = 1000;
  5.  
  6. int arr[N + 10];
  7.  
  8. int main(){
  9.  
  10.     int nPeople, nGot;
  11.     scanf("%d%d", &nPeople, &nGot);
  12.     for(int i = nPeople - nGot + 1; i <= nPeople; ++i){
  13.         scanf("%d", &arr[i]);
  14.     }
  15.     for(int i = 1; i <= nPeople - nGot; ++i){
  16.         scanf("%d", &arr[i]);
  17.     }
  18.  
  19.     for(int i = 1; i <= nPeople; ++i){
  20.         cout << arr[i] << ' ';
  21.     }
  22.  
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement