Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication24.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- void print_mas(int *arr, int len)
- {
- for (int i=0;i<len;i++)
- printf("%4d",arr[i]);
- putchar('\n');
- return;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- int a[8]={10,3,5,6,20,44,66,8};
- int x=10,i;
- int l=sizeof(a)/sizeof(int);
- bool isFound=false;
- print_mas(a,l);
- int *pos_l=a, *pos_r=(a+l-1);
- do
- {
- int z=*pos_l;
- *pos_l=*pos_r;
- *pos_r=z;
- } while (pos_l++<pos_r--);
- print_mas(a,l);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement