Advertisement
Guest User

Untitled

a guest
May 27th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include<clocale>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5.  
  6. const int n=10;;
  7.  
  8. int main()
  9. { setlocale(0, "");
  10.  
  11. int i, j, k;
  12.  
  13. int a[n], b[n];
  14.  
  15. int m = n;
  16. cout << "Введите десять значений элементов: " << endl;
  17.  
  18. for (i=0; i<n; i++)
  19. cin>>a[i];
  20. k=0;
  21.  
  22. for (i=0; i<m; i++)
  23. if (a[i] == 0)
  24. {
  25. for (j=i; j<n-1; j++)
  26.  
  27. { a[i] =a[i+1];}
  28. m--;
  29. }
  30. for (i=0; i<m; i++)
  31.  
  32. cout<<a[i]<<" ";
  33. cout<<"новый массив"<<endl;
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement