当前位置:网站首页>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 :
边栏推荐
- 凤凰架构3——事务处理
- map的使用(列表的数据赋值到表单,json逗号隔开显示赋值)
- Interview assault 63: how to remove duplication in MySQL?
- Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting
- Application of clock wheel in RPC
- Translation D28 (with AC code POJ 26:the nearest number)
- 全套教学资料,阿里快手拼多多等7家大厂Android面试真题
- Use of map (the data of the list is assigned to the form, and the JSON comma separated display assignment)
- 潇洒郎: AttributeError: partially initialized module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipe
- 【计算情与思】扫地僧、打字员、信息恐慌与奥本海默
猜你喜欢
IC设计流程中需要使用到的文件
凤凰架构3——事务处理
今日直播 | “人玑协同 未来已来”2022弘玑生态伙伴大会蓄势待发
第五期个人能力认证考核通过名单公布
系统性详解Redis操作Hash类型数据(带源码分析及测试结果)
蓝桥杯 微生物增殖 C语言
Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
A full set of teaching materials, real questions of Android interview of 7 major manufacturers including Alibaba Kwai pinduoduo
快速幂模板求逆元,逆元的作用以及例题【第20届上海大学程序设计联赛夏季赛】排列计数
Mysql Information Schema 學習(一)--通用錶
随机推荐
short i =1; i=i+1与short i=1; i+=1的区别
谷粒商城--分布式高级篇P129~P339(完结)
Mind map + source code + Notes + project, ByteDance + JD +360+ Netease interview question sorting
安装Mysql报错:Could not create or access the registry key needed for the...
学习探索-函数防抖
LeetCode_ Double pointer_ Medium_ 61. rotating linked list
Dom 操作
The slave i/o thread stops because master and slave have equal MySQL serv
快速幂模板求逆元,逆元的作用以及例题【第20届上海大学程序设计联赛夏季赛】排列计数
史上超级详细,想找工作的你还不看这份资料就晚了
LeetCode_双指针_中等_61. 旋转链表
中缀表达式转后缀表达式详细思路及代码实现
MySQL information schema learning (II) -- InnoDB table
Simple application of VBA script in Excel
10 schemes to ensure interface data security
黑马--Redis篇
Computer network: sorting out common network interview questions (I)
Leetcode 30. 串联所有单词的子串
Low CPU load and high loadavg processing method
usb host 驱动 - UVC 掉包