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