Guest
Login
跳过导航链接

Compile Error:

  :5:1: error: 'uusing' does not name a type
    5 | uusing namespace std;
      | ^~~~~~
:6:1: error: 'ddouble' does not name a type; did you mean 'double'?
    6 | ddouble factorial(int n) {
      | ^~~~~~~
      | double
: In function 'double series_sum(double)':
:18:45: error: 'factorial' was not declared in this scope
   18 |         term = pow(-1, n + 1) * pow(x, n) / factorial(n);
      |                                             ^~~~~~~~~
: In function 'int main()':
:30:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   30 |     while (cin >> x && x >= 0.0 && x <= 5.0) {
      |            ^~~
      |            std::cin
In file included from :1:
D:/msys64/ucrt64/include/c++/13.2.0/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
:32:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   32 |         cout << fixed << setprecision(6) << "x=" << x << ", sum=" << sum << endl;
      |         ^~~~
      |         std::cout
D:/msys64/ucrt64/include/c++/13.2.0/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
:32:17: error: 'fixed' was not declared in this scope; did you mean 'std::fixed'?
   32 |         cout << fixed << setprecision(6) << "x=" << x << ", sum=" << sum << endl;
      |                 ^~~~~
      |                 std::fixed
In file included from D:/msys64/ucrt64/include/c++/13.2.0/ios:44,
                 from D:/msys64/ucrt64/include/c++/13.2.0/ostream:40,
                 from D:/msys64/ucrt64/include/c++/13.2.0/iostream:41:
D:/msys64/ucrt64/include/c++/13.2.0/bits/ios_base.h:1084:3: note: 'std::fixed' declared here
 1084 |   fixed(ios_base& __base)
      |   ^~~~~
:32:26: error: 'setprecision' was not declared in this scope; did you mean 'std::setprecision'?
   32 |         cout << fixed << setprecision(6) << "x=" << x << ", sum=" << sum << endl;
      |                          ^~~~~~~~~~~~
      |                          std::setprecision
In file included from :2:
D:/msys64/ucrt64/include/c++/13.2.0/iomanip:197:3: note: 'std::setprecision' declared here
  197 |   setprecision(int __n)
      |   ^~~~~~~~~~~~
:32:77: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   32 |         cout << fixed << setprecision(6) << "x=" << x << ", sum=" << sum << endl;
      |                                                                             ^~~~
      |                                                                             std::endl
D:/msys64/ucrt64/include/c++/13.2.0/ostream:735:5: note: 'std::endl' declared here
  735 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~

  

Zhe Jiang University Of Technology Online Programming Space Beta1.3
Designed & Developped By Jin Qiwei
Refactored By cb@zjut.edu.cn , QQ Group: 723311416  All Copyright Reserved 2006-
62