Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int x, y;
- cin >> x >> y;
- int *ptrX = &x;
- int *ptrY = &y;
- cout << *ptrX << endl;
- cout << *ptrY << endl;
- cout << *ptrX + *ptrY << endl;
- return 0;
- }
- #include <iostream>
- using namespace std;
- int main ()
- {
- int n, arr[100];
- cin >> n;
- for (int i = 0; i < n; i++)
- {
- cin >> arr[i];
- }
- for (int i = n - 1; i >= 0; i--)
- {
- cout << *(arr + i) << endl;
- }
- return 0;
- }
- #include <iostream>
- using namespace std;
- int main ()
- {
- int n, arr[100];
- cin >> n;
- for (int i = 0; i < n; i++)
- {
- cin >> arr[i];
- }
- int *ptr = (arr + n - 1);
- while(n > 0)
- {
- cout << *ptr << endl;
- ptr--;
- n--;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement