当前位置:网站首页>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 :
边栏推荐
- GCC【7】- 编译检查的是函数的声明,链接检查的是函数的定义bug
- Sanmian ant financial successfully got the offer, and has experience in Android development agency recruitment and interview
- Don't miss this underestimated movie because of controversy!
- MATLAB中deg2rad和rad2deg函数的使用
- [translation] Digital insider. Selection process of kubecon + cloudnativecon in Europe in 2022
- RT-Thread 组件 FinSH 使用时遇到的问题
- The list of people who passed the fifth phase of personal ability certification assessment was published
- 【翻译】数字内幕。KubeCon + CloudNativeCon在2022年欧洲的选择过程
- 凤凰架构2——访问远程服务
- Druid 数据库连接池 详解
猜你喜欢
Mind map + source code + Notes + project, ByteDance + JD +360+ Netease interview question sorting
Interface test tool - postman
MySQL information schema learning (II) -- InnoDB table
MySQL information schema learning (I) -- general table
Live broadcast today | the 2022 Hongji ecological partnership conference of "Renji collaboration has come" is ready to go
Systematic and detailed explanation of redis operation hash type data (with source code analysis and test results)
Chic Lang: attributeerror: partially initialized module 'CV2' has no attribute 'GAPI_ wip_ gst_ GStreamerPipe
LeetCode_ Double pointer_ Medium_ 61. rotating linked list
php+redis实现超时取消订单功能
【基础架构】Flink/Flink-CDC的部署和配置(MySQL / ES)
随机推荐
蓝桥杯 微生物增殖 C语言
Swiftui game source code Encyclopedia of Snake game based on geometryreader and preference
How to customize animation avatars? These six free online cartoon avatar generators are exciting at a glance!
通俗的讲解,带你入门协程
Mysql Information Schema 学习(二)--Innodb表
【翻译】云原生观察能力微调查。普罗米修斯引领潮流,但要了解系统的健康状况仍有障碍...
Druid 数据库连接池 详解
JDBC详解
Computer network: sorting out common network interview questions (I)
【计算情与思】扫地僧、打字员、信息恐慌与奥本海默
Use of map (the data of the list is assigned to the form, and the JSON comma separated display assignment)
今日直播 | “人玑协同 未来已来”2022弘玑生态伙伴大会蓄势待发
黑马--Redis篇
DaGAN论文解读
Use of deg2rad and rad2deg functions in MATLAB
第五期个人能力认证考核通过名单公布
Don't miss this underestimated movie because of controversy!
ACTF 2022圆满落幕,0ops战队二连冠!!
Hudi vs Delta vs Iceberg
How to access localhost:8000 by mobile phone