Advertisement
sellmmaahh

popravni-2013-zad5

Jul 28th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. template <typename Tip>
  8. bool DaLiJeSimetrican (Tip It1, Tip It2) {
  9.     int duzina{It2-It1};
  10.     It2--;
  11.     for (int i=0; i<duzina/2; i++)
  12.         {
  13.         if (*It1!=*It2)  return false;
  14.             It1++;
  15.             It2--;
  16.  
  17.         }
  18.         return true;
  19.  
  20. }
  21.  
  22. int main () {
  23. int niz[10]={3,5,1,9,5,4,7,5,1};
  24. bool rez{DaLiJeSimetrican(niz,niz+10)};
  25. cout<<rez;
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement