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

牛牛的四叶玫瑰数

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

#include <stdio.h>
#include <math.h>
int main() 
{
    int a,b;
    scanf("%d %d",&a,&b);
    for (int i = 0 ; i < b ; i++)
    {
        int c = 0, d = a + i;
        while(d)
        {
            c += pow((d%10),4);
            d /= 10;
        }
        if (c == (a + i))
        {
            printf("%d ", c);
        }
    }
    return 0;
}

全部评论

相关推荐

09-14 16:00
已编辑
西安电子科技大学 C++
点赞 评论 收藏
分享
zxxxxxr:不是挂了,是美团招聘特有机制,三天第一志愿没处理会自动结束跳转到第二志愿,以此类推,只要有人后面捞也会回到第一志愿的
投递美团等公司10个岗位
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务