为了账号安全,请及时绑定邮箱和手机立即绑定

这个程序到底哪里错了?

这个程序到底哪里错了?

C
一直两个人 2016-02-10 15:10:52
#include <stdio.h>int main(){    //定义三位数num,个位数sd,十位数td,百位数hd    int num, sd, td, hd;    //循环所有三位数    for(   num=100  ;  num<1000   ;    num++  )    {        //获取三位数字num百位上的数字        hd = num / 100 ;               ;        //获取三位数字num十位上的数字        td = (num % 100 )/10;               ;        //获取三位数字num个位上的数字        sd = num % 10;                ;        //水仙花数的条件是什么?        if(     num==hd*hd*hd+td*td*td+ sd*sd*sd)                         {            printf("水仙花数字:%d\n", num);            }    }    return 0;    }
查看完整描述

1 回答

已采纳
?
喜欢海其实是喜欢浪

TA贡献5条经验 获得超5个赞

//img1.sycdn.imooc.com//56c1d843000102fe07690448.jpg

运行结果难道不对吗?

查看完整回答
反对 回复 2016-02-15
  • 1 回答
  • 0 关注
  • 1509 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信