fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int stopien = 3;
  8. int a3 = 1;
  9. int a2 = 3;
  10. int a1 = 1;
  11. int a0 = 4;
  12. int x = 2;
  13.  
  14. int W = a3 * pow(x, 3)
  15. + a2 * pow(x, 2)
  16. + a1 * pow(x, 1)
  17. + a0;
  18.  
  19. cout << "stopien wielomianu: " << stopien << endl;
  20. cout << "a3 = " << a3 << endl;
  21. cout << "a0 = " << a0 << endl;
  22. cout << "x = " << x << endl;
  23. cout << "W(2) = " << W << endl;
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
stopien wielomianu: 3
a3 = 1
a0 = 4
x = 2
W(2) = 26