Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void mas(double* a, int n) {
- double buf = 0;
- for (int i = 0, j = n - 1; i<j; i++, j--)
- {
- buf = a[i];
- a[i] = a[j];
- a[j] = buf;
- }
- }
- int main()
- {
- int n = 10;
- double* i = new double[n];
- for (int a = 0; a < n; a++) {
- i[a] = a + 0.5;
- }
- mas(i,n);
- for (int a = 0; a < n; a++) {
- cout << i[a] << " ";
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement