Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cout << "Podaj ilosc liczb: ";
- cin>>n;
- int tablica[n];
- for(int i=0;i<n;i++)
- {
- cin>>tablica[i];
- }
- for(int i=0;i<n;i++)
- {
- cout<<tablica[i]<<endl;
- }
- int ilosc=n/2;
- int pom;
- for(int i=0;i<ilosc; i++ )
- {
- pom=tablica[i];
- tablica[i]=tablica[n-1-i];
- tablica[n-1-i]=pom;
- }
- cout<<endl;
- for(int i=0;i<n;i++)
- {
- cout<<tablica[i]<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement