题解 | #变种水仙花#

变种水仙花

http://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71

{
    int i=0;
    for(i=10000;i<100000;i++)
    {
        int count=0;
        for(int j=10;j<=i;j*=10)
         {
              int m=i%j;
              int n=i/j;
            count+=m*n;
         }
          if(count==i)
          {
              printf("%d ",i);
          }
    }
    return 0;
}
全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务