C++水仙花数

作者在 2020-02-24 00:03:42 发布以下内容


 int aa = 111, aaa = 0, aaaa = 0, a = aa;
 while (a < 999)
 { //缘由https://bbs.bccn.net/viewthread.php?tid=499370&pid=2719622&page=1#pid2719622
  if (aa)aaa = aa % 10, aaaa += aaa*aaa*aaa, aa /= 10;
  else
  if (a == aaaa)cout << a << ends, aa = ++a, aaaa = 0; else aa = ++a, aaaa = 0;
 }
无标题.png (上传于2020-02-24 00:03:42)
无标题.png


默认分类 | 阅读 1295 次
文章评论,共0条
游客请输入验证码