问题描述
#include <stdio.h>
#include <math.h>
main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
double ans= pow(a,b);
printf("%f",ans);
}
我编写了这段代码并尝试在 Visual stdio (linux) 中运行。但它给出了一条错误消息。
msg- new_year_candles.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 4 | main() | ^~~~ /usr/bin/ld: /tmp/ccCQbbLV.o: in function `main': new_year_candles.c:(.text+0x4a): undefined reference to `pow' collect2: error: ld returned 1 exit status
现在该怎么办?