Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int numbers[10];
- int n;
- cout<<"N = ";
- cin>>n;
- cout<<endl;
- for(int i = 0; i < n; i++)
- {
- cout<<"Number "<< i + 1<<" = ";
- cin>>numbers[i];
- }
- cout<<endl;
- for(int i = 0; i < (n - n % 2) / 2; i++)
- {
- if(numbers[i] != numbers[n - i - 1])
- {
- cout<<"False";
- break;
- }
- if(i == (n - n % 2) / 2 - 1)
- {
- cout<<"True";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement