路之予


私信TA

用户名:0x83cfdd3c

访问量:17533

签 名:

与世界过招。

等  级
排  名 716
经  验 3771
参赛次数 0
文章发表 36
年  龄 0
在职情况 学生
学  校 Bilibili University
专  业 CS

  自我简介:



参考代码:

#include<stdio.h>
#include<math.h>
int main() {
	int a,b,c;
	for(int i=100; i<1000; ++i) {
		a=i/100;
		b=i%10;
		c=i/10%10;
		if(i==pow(a,3)+pow(b,3)+pow(c,3))
			printf("%d\n",i);
	}
	return 0;
}


 

0.0分

3 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区

在编译器上说pow为多重定义符运行不了
2023-11-01 15:55:23
#include "stdio.h"
#include "math.h"


int main()

{
	int i=2;
	
	while (i < 1000)
	{
		
		if ((pow(i / 100 , 3) + pow(i / 10 % 10, 3) + pow(i % 10, 3)) == i)
			printf("%d\n", i);
		i++;		
	}
	system("pause");
	return 0;
}
2023-01-15 09:05:57
  • «
  • 1
  • »