Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- int main()
- {
- int a[20], i, n;
- cout<<"Vnesi kolku elementi kje ima nizata "<<endl;
- cin>>n;
- cout<<"Vnesi gi elementite na prvata nizata "<<endl;
- for(i=0;i<n;i++)
- {
- cin>>a[i];
- }
- int flag=1;
- int p=n;
- for(i=0;i<n;i++)
- {
- if(a[i]!=a[p-1])
- {
- flag=0;
- }
- p--;
- }
- if(flag==1)
- {
- cout<<"Nizata se chita isto i od napred i od pozadi"<<endl;
- }
- else
- {
- cout<<"Nizata NE se chita isto od napred i od pozadi"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement