Advertisement
amermo

Samostalni 5 - Z21

Apr 2nd, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. template <typename TipElemenata, typename TipFunkcije>
  4. TipElemenata UzastopnaFunkcija(TipElemenata x, TipFunkcije f, int n)
  5. {
  6.     if(n == 0)
  7.         return x;
  8.     TipElemenata Rezultat(f(x));
  9.     for(int i(1); i < n; i++)
  10.         Rezultat = f(Rezultat);
  11.     return Rezultat;
  12. }
  13.  
  14. int main()
  15. {
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement