当前位置:网站首页>[exercise C] number of varieties of daffodils
[exercise C] number of varieties of daffodils
2022-07-18 01:40:00 【Domeecky】
link : Mutant daffodils __ Cattle from
source : Cattle from
Number of mutant daffodils - Lily Number: Put any number , Split into two numbers from the middle , such as 1461 Can be broken down into (1 and 461),(14 and 61),(146 and 1), If the sum of all split products is equal to itself , It is a Lily Number.
for example :
655 = 6 * 55 + 65 * 5
1461 = 1*461 + 14*61 + 146*1
Find out 5 All of the digits Lily Number.
#include<stdio.h>
#include<math.h>
int main()
{
int ret = 0;
for (int i = 10000; i <= 99999; i++)
{
ret = 0;
for (int j = 1; j <= 4; j++)
{
ret += (i / ((int)pow(10, j))) * ((i % (int)pow(10, j)));
//pow What I'm looking for is 10 Of j Power , The return is double type , A cast is required
// According to yes j The power can be obtained in turn i All kinds of combinations of
}
if (ret == i)
printf("%d ", i);
}
return 0;
}
边栏推荐
- 不同阶段的领悟
- Data Lake (19): SQL API reads Kafka data and writes it to iceberg table in real time
- Thinking of reading
- nosql概述
- 【HCIA】OSI 模型
- C语言(程序环境和预处理)
- Connecting with enterprise wechat, customer relationship management can also be very simple!
- It's time to say goodbye gracefully to nullpointexception
- After the WebView page of the applet is forwarded, open the page blank
- 今日睡眠质量记录80分
猜你喜欢
![[C exercise] input the month and year, and calculate the number of days in the month](/img/41/11d02273e27eee3bf97815da03bca5.png)
[C exercise] input the month and year, and calculate the number of days in the month

STM32应用开发实践教程:环境光照强度监测的应用开发

数据传输:同构异IP数据源批量抽取实践

Online variety show was cold: "Aiyou tengmang" couldn't be put away, "shake up B" couldn't win

029. Copying and moving of documents

STM32 application development practice tutorial: application development of environmental light intensity monitoring

Matlab底层源代码实现Halcon scale_image_max算子效果

手机浏览器产品分析

Redis入门介绍
![[latex Chinese and English style & Bold] freely choose Chinese and English font styles, and set the bold and black degree of Chinese and English fonts](/img/36/db868e14b32b9f42c7c0dd9187d6a8.png)
[latex Chinese and English style & Bold] freely choose Chinese and English font styles, and set the bold and black degree of Chinese and English fonts
随机推荐
Solution of in multi column special query type in laravel
树莓派串口通信
【C】实用调试技巧
Node connects to the database for addition, deletion, modification and query
现在网上开户安全么?想咨询一下,国债逆回购是什么?
2020ccpc Qinhuangdao exam results (ruler)
Markdown extended syntax
mysql面试
What is website ICP filing?
字符串相关函数和内存相关函数的实现
Realizing Halcon scale with MATLAB low-level source code_ image_ Range (can be used for background segmentation)
云小店商城源码修复30套模板支持一键对接各大系统
Data Lake (XVII): Flink and iceberg integrate datastream API operations
【C 练习】序列中删除指定的数字
容器面试问题
持久化分析
QT | vs2017 + qt5.14.2 environment construction
【C 练习】喝汽水
Online variety show was cold: "Aiyou tengmang" couldn't be put away, "shake up B" couldn't win
cdn加速是什么