警告!!!9*WA & 1*AC
查看原帖
警告!!!9*WA & 1*AC
1025203
yahu2023楼主2023/10/15 15:44

誰帮我检查一下啊o(╥﹏╥)o

我用cpp编译是错误0

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,ans;
    double x,number;
    cin >> x >> n;
    for(ans = 1;ans <= n + 1;ans++)
    {
        number += pow(ans,x);
    }
    cout << fixed << setprecision(2) << number;
    return 0;
}
2023/10/15 15:44
加载中...