小编She*_*ade的帖子

错误:“pow”未在此范围内声明

#include <iostream>

using namespace std;

int main()
{
    int x;

    cout << "How many rows would you like? " << endl;
    cin >> x;
    cout << endl;
    cout << "Number| Power 1| Power 2| Power 3| Power 4| Power 5" << endl;

    for (int j=0; j<=x; j++)
    {
        cout << j << "\t" << j << "\t" << pow(j,2) << "\t" << pow(j,3) << 
"\t" << pow(j,4) << "\t" << pow(j,5) << endl;

    }

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

它会产生上述错误。我不确定出了什么问题,请告诉我。先感谢您。

c++

-5
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1