比赛地址:https://bbs.huaweicloud.com/forum/thread-29407-1-1.html
中级赛题:"水仙花数"判断
·题目介绍
输入一个三位数判断是否为"水仙花数",水仙花数指该三位数每个位上的数字立方和等于它本身,即A³+B³+C³=ABC
·示例
输入:153
输出:True
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICE

本文介绍了华为中级赛题——判断一个三位数是否为水仙花数。水仙花数是指每位数字的立方和等于其本身的三位数。例如,153是一个水仙花数,因为1³+5³+3³=153。
最低0.47元/天 解锁文章
5120

被折叠的 条评论
为什么被折叠?



