相关疑难解决方法(0)

代码块电源功能在c中不起作用

我正在使用代码块来学习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功能.

c c++ codeblocks

1
推荐指数
1
解决办法
4409
查看次数

标签 统计

c ×1

c++ ×1

codeblocks ×1