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

边栏推荐
- PMP每日一练 | 考试不迷路-7.6
- Hudi vs Delta vs Iceberg
- 冒烟测试怎么做
- zabbix 代理服务器 与 zabbix-snmp 监控
- Interpretation of Dagan paper
- Tensorflow and torch code verify whether CUDA is successfully installed
- short i =1; I=i+1 and short i=1; Difference of i+=1
- [translation] micro survey of cloud native observation ability. Prometheus leads the trend, but there are still obstacles to understanding the health of the system
- Take a look at how cabloyjs workflow engine implements activiti boundary events
- C language daily practice - day 22: Zero foundation learning dynamic planning
猜你喜欢

Systematic and detailed explanation of redis operation hash type data (with source code analysis and test results)

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

安装Mysql报错:Could not create or access the registry key needed for the...

Documents to be used in IC design process

Druid 数据库连接池 详解

Interview assault 63: how to remove duplication in MySQL?

在解决了 2961 个用户反馈后,我做出了这样的改变...
![Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting](/img/dd/c3f4a9c38b156e3a9b9adfd6253773.gif)
Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting

中缀表达式转后缀表达式详细思路及代码实现

MySQL information schema learning (I) -- general table
随机推荐
Translation D28 (with AC code POJ 26:the nearest number)
MySQL information schema learning (I) -- general table
MySql必知必会学习
[玩转Linux] [Docker] MySQL安装和配置
ModuleNotFoundError: No module named ‘PIL‘解决方法
GCC【7】- 编译检查的是函数的声明,链接检查的是函数的定义bug
C language daily practice - day 22: Zero foundation learning dynamic planning
【翻译】云原生观察能力微调查。普罗米修斯引领潮流,但要了解系统的健康状况仍有障碍...
【翻译】供应链安全项目in-toto移至CNCF孵化器
The second day of rhcsa study
Dark horse -- redis
Mathematical knowledge -- code implementation of Gaussian elimination (elementary line transformation to solve equations)
JDBC详解
Benefit a lot, Android interview questions
How can my Haskell program or library find its version number- How can my Haskell program or library find its version number?
Swiftui game source code Encyclopedia of Snake game based on geometryreader and preference
Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
Interview assault 63: how to remove duplication in MySQL?
spark基础-scala
Mysql Information Schema 学习(一)--通用表