Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- template <typename Tip>
- bool DaLiJeSimetrican (Tip It1, Tip It2) {
- int duzina{It2-It1};
- It2--;
- for (int i=0; i<duzina/2; i++)
- {
- if (*It1!=*It2) return false;
- It1++;
- It2--;
- }
- return true;
- }
- int main () {
- int niz[10]={3,5,1,9,5,4,7,5,1};
- bool rez{DaLiJeSimetrican(niz,niz+10)};
- cout<<rez;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement