int f(int b)
{
return b*b
}
main()
{
int b=5
printf("%d\n",f(5))
}
可以用b=a*a来算,也可以用math库的pow函数来算要用pow首先要包含头文件
#include
然后调用pow函数
double
pow(
double
base,
double
exp
)
函数返回以base为底的exp次,不允许的取值范围:
当base
为
0
且exp
小于或等于
0
当base
为
且
exp
不为整数
int f(int b)
{
return b*b
}
main()
{
int b=5
printf("%d\n",f(5))
}
可以用b=a*a来算,也可以用math库的pow函数来算要用pow首先要包含头文件
#include
然后调用pow函数
double
pow(
double
base,
double
exp
)
函数返回以base为底的exp次,不允许的取值范围:
当base
为
0
且exp
小于或等于
0
当base
为
且
exp
不为整数