文章

13

粉丝

0

获赞

3

访问

646

头像
水仙花数 题解:
P1034 中南大学机试题
发布于2026年5月18日 17:45
阅读数 56

#include <stdio.h>
#include<stdbool.h>
bool flower(int x)
{
    int sum,temp,k;
    temp=x;
    sum=0;
    while(temp!=0)
    {
        k=temp%10;
        sum+=k*k*k;
        temp=temp/10;
    }
    if(sum==x)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
int main()
{
    int i,m,n;
    while(scanf("%d %d",&m,&n)!=EOF&&m!=0)
    {
        int count=0;
        for(i=m;i<=n;i++)
        {
         &n...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发