Advertisement
mostlabs

6/3

Dec 11th, 2019
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include<iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7.  
  8. {
  9.    
  10.    
  11.     unsigned short n;
  12.  
  13.        cout << "n = ";
  14.        cin >> n;
  15.        float* mas = new float[n];
  16.        float* mas2 = new float[n-1];
  17.         int p;
  18.      for (int i = 0; i < n; i++)
  19.          cin >> mas[i];
  20.          
  21.          
  22.     for(int i=0 ; i < n ; i++)
  23.         cout << mas[i] << " " ;
  24.        
  25.         cout << endl;
  26.         int pos;
  27.     cin >> pos;
  28.     for(int i=pos; i < n ;i++){
  29.         mas2[p]=mas[i];
  30.          p++;
  31.     }
  32.     for(int i = 0 ; i < n-1 ; i++)
  33.     cout << mas2[i] << " ";
  34. delete []mas;
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement