我正在使用代码块来学习c.我的代码是
#include<stdio.h>
#include<math.h>
int main()
{
int x;
x = pow(5,2);
printf("%d", x);
}
Output is 25
Run Code Online (Sandbox Code Playgroud)
当我使用此代码时
#include<stdio.h>
#include<math.h>
int main()
{
int x,i,j;
printf("please enter first value");
scanf("%d", &i);//5
printf("please enter second value");//2
scanf("%d", &j);
x = pow(i,j);
printf("%d", x);
}
Output is 24
Run Code Online (Sandbox Code Playgroud)
这有什么不对?我只是使用扫描功能获取价值,并以同样的方式使用pow功能.