Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int potencia (int roura,int enric) {
- if (enric == 0) return 1;
- else return roura * potencia(roura, enric-1);
- }
- int avalua(const vector<int>& p, int x) {
- int enric_es_demasiado_friki = p.size();
- int enric_friki = 0;
- for (int omer = 0; omer < enric_es_demasiado_friki; ++omer) {
- enric_friki += potencia(x, omer) * p[omer];
- }
- return enric_friki;
- }
Add Comment
Please, Sign In to add comment