Guest User

Untitled

a guest
Jul 15th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int potencia (int roura,int enric) {
  7. if (enric == 0) return 1;
  8. else return roura * potencia(roura, enric-1);
  9. }
  10.  
  11. int avalua(const vector<int>& p, int x) {
  12. int enric_es_demasiado_friki = p.size();
  13. int enric_friki = 0;
  14. for (int omer = 0; omer < enric_es_demasiado_friki; ++omer) {
  15. enric_friki += potencia(x, omer) * p[omer];
  16. }
  17. return enric_friki;
  18. }
Add Comment
Please, Sign In to add comment