题解 | #牛牛的四叶玫瑰数#

牛牛的四叶玫瑰数

https://www.nowcoder.com/practice/b1ee23676ad54919b50aa1a09da1704e

#include <stdio.h>
#include <math.h>
int main()//水仙花数,各数字计算 
{
	int n, m;
	scanf("%d %d", &n, &m);

	for (int i = n; i <= m; i++)
	{
		int w = 0, temp = 0, te = i;
		while (te)
		{
			temp = te % 10;//个位
			w += pow(temp, 4);
			te /= 10;//减一位
		}

		if (w == i)
			printf("%d ", i);
	}
	return 0;
}

全部评论

相关推荐

一表renzha:手写数字识别就是一个作业而已
点赞 评论 收藏
分享
06-19 19:06
门头沟学院 Java
码农索隆:别去东软,真学不到东西,真事
点赞 评论 收藏
分享
这不纯纯作弊了吗😢😢😢
编程界菜鸡:信这个的这辈子有了,这智商你靠啥都没用
你找工作的时候用AI吗?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务