Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- template <typename TipElemenata, typename TipFunkcije>
- std::vector<TipElemenata> UzastopnaFunkcija(TipElemenata x, TipFunkcije f, int n)
- {
- std::vector<TipElemenata> Rezultat;
- if(n == 0)
- Rezultat.push_back(x);
- else
- {
- Rezultat.push_back(f(x));
- for(int i(1); i < n; i++)
- Rezultat.push_back(f(Rezultat[i-1]));
- }
- return Rezultat;
- }
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement