当前位置:网站首页>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 :

边栏推荐
- Interview assault 63: how to remove duplication in MySQL?
- Php+redis realizes the function of canceling orders over time
- 系统性详解Redis操作Hash类型数据(带源码分析及测试结果)
- In 50W, what have I done right?
- 史上超级详细,想找工作的你还不看这份资料就晚了
- 反射及在运用过程中出现的IllegalAccessException异常
- How to do smoke test
- How to type multiple spaces when editing CSDN articles
- C # - realize serialization with Marshall class
- Benefit a lot, Android interview questions
猜你喜欢
![[translation] a GPU approach to particle physics](/img/07/57036c925155cab36678c696e89440.jpg)
[translation] a GPU approach to particle physics

Analysis of rainwater connection

全套教学资料,阿里快手拼多多等7家大厂Android面试真题

Black Horse - - Redis Chapter

Don't miss this underestimated movie because of controversy!

蓝桥杯 微生物增殖 C语言

Chic Lang: attributeerror: partially initialized module 'CV2' has no attribute 'GAPI_ wip_ gst_ GStreamerPipe

黑馬--Redis篇

Mathematical knowledge -- code implementation of Gaussian elimination (elementary line transformation to solve equations)

Solution of intelligent management platform for suppliers in hardware and electromechanical industry: optimize supply chain management and drive enterprise performance growth
随机推荐
第五期个人能力认证考核通过名单公布
零基础入门PolarDB-X:搭建高可用系统并联动数据大屏
如何自定义动漫头像?这6个免费精品在线卡通头像生成器,看一眼就怦然心动!
350. 两个数组的交集 II
MySQL information schema learning (I) -- general table
Mysql Information Schema 学习(二)--Innodb表
10 schemes to ensure interface data security
CF960G - Bandit Blues(第一类斯特林数+OGF)
Tensorflow and torch code verify whether CUDA is successfully installed
Interview assault 63: how to remove duplication in MySQL?
[translation] a GPU approach to particle physics
Dom 操作
Interface test tool - postman
An error occurs when installing MySQL: could not create or access the registry key needed for the
在解决了 2961 个用户反馈后,我做出了这样的改变...
First day of rhcsa study
力扣101题:对称二叉树
Solution of intelligent management platform for suppliers in hardware and electromechanical industry: optimize supply chain management and drive enterprise performance growth
从sparse.csc.csr_matrix生成邻接矩阵
中缀表达式转后缀表达式详细思路及代码实现