当前位置:网站首页>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 :
边栏推荐
- Characteristic colleges and universities, jointly build Netease Industrial College
- LeetCode_格雷编码_中等_89.格雷编码
- Druid 数据库连接池 详解
- Simple understanding of MySQL database
- map的使用(列表的数据赋值到表单,json逗号隔开显示赋值)
- Benefit a lot, Android interview questions
- Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting
- 中缀表达式转后缀表达式详细思路及代码实现
- JDBC details
- 零基础入门PolarDB-X:搭建高可用系统并联动数据大屏
猜你喜欢
面试突击63:MySQL 中如何去重?
How to access localhost:8000 by mobile phone
[translation] linkerd's adoption rate in Europe and North America exceeded istio, with an increase of 118% in 2021.
10 schemes to ensure interface data security
MySQL information schema learning (I) -- general table
JDBC详解
Interview assault 63: how to remove duplication in MySQL?
Solution of commercial supply chain management platform for packaging industry: layout smart supply system and digitally integrate the supply chain of packaging industry
Cereals Mall - Distributed Advanced p129~p339 (end)
Mind map + source code + Notes + project, ByteDance + JD +360+ Netease interview question sorting
随机推荐
Intelligent supply chain management system solution for hardware and electromechanical industry: digital intelligent supply chain "creates new blood" for traditional industries
Spark foundation -scala
[translation] Digital insider. Selection process of kubecon + cloudnativecon in Europe in 2022
Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
【翻译】供应链安全项目in-toto移至CNCF孵化器
思維導圖+源代碼+筆記+項目,字節跳動+京東+360+網易面試題整理
学习探索-函数防抖
Cereals Mall - Distributed Advanced p129~p339 (end)
Swiftui game source code Encyclopedia of Snake game based on geometryreader and preference
关于图像的读取及处理等
Test technology stack arrangement -- self cultivation of test development engineers
Use of map (the data of the list is assigned to the form, and the JSON comma separated display assignment)
Characteristic colleges and universities, jointly build Netease Industrial College
全套教学资料,阿里快手拼多多等7家大厂Android面试真题
【翻译】数字内幕。KubeCon + CloudNativeCon在2022年欧洲的选择过程
Mysql Information Schema 学习(一)--通用表
Take a look at how cabloyjs workflow engine implements activiti boundary events
10 schemes to ensure interface data security
Solution of commercial supply chain management platform for packaging industry: layout smart supply system and digitally integrate the supply chain of packaging industry
Live broadcast today | the 2022 Hongji ecological partnership conference of "Renji collaboration has come" is ready to go