当前位置:网站首页>Blue Bridge Cup microbial proliferation C language
Blue Bridge Cup microbial proliferation C language
2022-07-06 19:35:00 【Large dish color】
Microbial proliferation
Suppose there are two microorganisms X and Y
X Every... After birth 3 Split once a minute ( Double the number ),Y Every... After birth 2 Split once a minute ( Double the number ).
A new born X, Eat it in half a minute 1 individual Y, also , From the start , every other 1 Minutes to eat 1 individual Y.
It is now known that there are new born X=10, Y=89, seek 60 Minutes later Y Number of .
If X=10,Y=90 Well ?
The requirement of this question is to write under these two initial conditions ,60 Minutes later Y Number of .
The following program realizes this function , Please fill in the blanks :
Tips :Y The separation will be in 0.5,1.5,2.5······ Be eaten when , therefore , hold 60 Minutes are divided into 120 Share , Then divide by 2 Remainder is 1 when ,Y The number of students is decreasing X individual
When X=10, Y=89, Code :
#include<stdio.h>
int main()
{
int x=10,y=89;
for(int t=1;t<=120;t++) // Half a minute is a unit 60 Minutes for 120 A unit of
{
if(t%2==1)
y=y-x; // because X Half a minute after birth Y, After every 1 Minutes to eat Y, So it is always an odd number of half minutes to eat Y
if(t%4==0) // Double every two minutes
y=y*2;
if(t%6==0) // Double every three minutes
x=x*2;
}
printf("%d",y);
return 0;
} The running result is negative , so y=0.
When X=10, Y=90, Running results :

边栏推荐
- 全套教学资料,阿里快手拼多多等7家大厂Android面试真题
- Help improve the professional quality of safety talents | the first stage of personal ability certification and assessment has been successfully completed!
- 从sparse.csc.csr_matrix生成邻接矩阵
- 黑馬--Redis篇
- Take a look at how cabloyjs workflow engine implements activiti boundary events
- 三面蚂蚁金服成功拿到offer,Android开发社招面试经验
- MySql必知必会学习
- 【翻译】数字内幕。KubeCon + CloudNativeCon在2022年欧洲的选择过程
- [translation] supply chain security project in toto moved to CNCF incubator
- Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
猜你喜欢

数学知识——高斯消元(初等行变换解方程组)代码实现
![[translation] micro survey of cloud native observation ability. Prometheus leads the trend, but there are still obstacles to understanding the health of the system](/img/63/3addcecb69dcb769c4736653952f66.png)
[translation] micro survey of cloud native observation ability. Prometheus leads the trend, but there are still obstacles to understanding the health of the system

Help improve the professional quality of safety talents | the first stage of personal ability certification and assessment has been successfully completed!

LeetCode-1279. Traffic light intersection

spark基础-scala

It's super detailed in history. It's too late for you to read this information if you want to find a job

思维导图+源代码+笔记+项目,字节跳动+京东+360+网易面试题整理

An error occurs when installing MySQL: could not create or access the registry key needed for the
Application of clock wheel in RPC

Druid database connection pool details
随机推荐
Dark horse -- redis
Take a look at how cabloyjs workflow engine implements activiti boundary events
JDBC details
How to customize animation avatars? These six free online cartoon avatar generators are exciting at a glance!
力扣101题:对称二叉树
【基础架构】Flink/Flink-CDC的部署和配置(MySQL / ES)
Use of map (the data of the list is assigned to the form, and the JSON comma separated display assignment)
通俗的讲解,带你入门协程
PMP每日一练 | 考试不迷路-7.6
[translation] linkerd's adoption rate in Europe and North America exceeded istio, with an increase of 118% in 2021.
Tensorflow2.0 自定义训练的方式求解函数系数
冒烟测试怎么做
【翻译】数字内幕。KubeCon + CloudNativeCon在2022年欧洲的选择过程
Intelligent supply chain management system solution for hardware and electromechanical industry: digital intelligent supply chain "creates new blood" for traditional industries
[translation] a GPU approach to particle physics
Problems encountered in using RT thread component fish
DaGAN论文解读
121. 买卖股票的最佳时机
Don't miss this underestimated movie because of controversy!
Characteristic colleges and universities, jointly build Netease Industrial College