Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = input('Qual o grau do polimonio?');
- a = zeros([1,n+1]);
- for v = (n+1): -1: 1
- input_text = sprintf('Introduza um valor para o "a" na ordem #%d:', v-1);
- a(1,v) = input(input_text);
- end
- x0 = input('Qual o valor de x?');
- p = a(1,n+1);
- for z = n:-1:1
- p = (p * x0 + a(1,z));
- end
- fprintf('O resultado é %d\n', p);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement