gpt4 book ai didi

c - Pow:对重载函数的模糊调用

转载 作者:行者123 更新时间:2023-12-01 02:47:01 25 4
gpt4 key购买 nike

<分区>

我有问题,我找不到任何解决方案。

它给出了同样的错误:

Pow: ambiguous call to overloaded function

#include <stdio.h>
#include <math.h>

int main()
{
int a, i, n, product, result=1;

printf("enter a number\n");
scanf("%d", &a);

printf("enter n number\n");
scanf("%d", &n);

for(i = 1; i < n; i++) {
product = pow(a, i);
result *= product;
}
printf("the result is %d", result);

return 0;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com