Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6883 | 侯宜辰 | 06计算f(x)的值 | C++ | Compile Error | 0 MS | 0 KB | 343 | 2025-03-22 20:37:45 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int x,a,b,c,d; cin>>x>>a>>b>>c>>d; cout<<a*x^3+b*x^2+c*x+d; return 0; }
Main.cc: In function 'int main()': Main.cc:10:14: error: no match for 'operator^' (operand types are 'std::basic_ostream' and 'int') cout' to 'std::_Ios_Fmtflags' /usr/include/c++/4.8.2/bits/ios_base.h:123:3: note: constexpr std::_Ios_Openmode std::operator^(std::_Ios_Openmode, std::_Ios_Openmode) operator^(_Ios_Openmode __a, _Ios_Openmode __b) ^ /usr/include/c++/4.8.2/bits/ios_base.h:123:3: note: no known conversion for argument 1 from 'std::basic_ostream' to 'std::_Ios_Openmode' /usr/include/c++/4.8.2/bits/ios_base.h:161:3: note: constexpr std::_Ios_Iostate std::operator^(std::_Ios_Iostate, std::_Ios_Iostate) operator^(_Ios_Iostate __a, _Ios_Iostate __b) ^ /usr/include/c++/4.8.2/bits/ios_base.h:161:3: note: no known conversion for argument 1 from 'std::basic_ostream' to 'std::_Ios_Iostate' Main.cc:10:16: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses] cout<a*x^3+b*x^2+c*x+d; ^