1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include <iostream> #include <cmath> using namespace std; int main() { cout.flush(); int sum = 0, total = 0; for (int i=1; i<=10; i++) { sum = pow(i, 2); total += sum; } cout<<"Sum = " <<total; cin.get(); return 0; }
1 2 3
In function 'int main()': Line 15: error: call of overloaded 'pow(int&, int)' is ambiguous compilation terminated due to -Wfatal-errors.