作业帮 > 英语 > 作业

英语翻译重写的程序Time Limit:1000MS Memory Limit:65536KTotal Submit:5

来源:学生作业帮 编辑:拍题作业网作业帮 分类:英语作业 时间:2024/04/27 23:57:57
英语翻译
重写的程序
Time Limit:1000MS Memory Limit:65536K
Total Submit:54 Accepted:24
Description
Recently Doctor Guan has discovered two new kinds of bacteria and named them BT-U and BT-V .BT-U and BT-V are quite special,they can only live with the help of each other.Doctor Guan did several experiments on BT-U and BT-V,here’re the results:
Put 100 BT-Us and 80 BT-Vs together ,one minute later ,there are 20 BT-Us and 80 BT-Vs ,one minute later again ,there are 20 BT-Us and 60 BT-Vs,then 20 BT-Us and 40 BT-Vs ,then 20 BT-Us and 20 BT-Vs ,then these 20 BT-Us and 20 BT-Vs keep alive.
Put 3 BT-Us and 5 BT-Vs together ,one minute later ,there are 3 BT-Us and 2 BT-Vs ,one more minute later there are 1 BT-U and 2 BT-Vs,then 1 BT-U and 1 BT-V,and this 1 BT-U and 1 BT-V keep alive.
According to the results above,Doctor Guan has reached a conclusion that when putting x BT-Us and y BT-Vs together,if x=y then they keep alive,if x < y then x BT-Vs would die in one minute,if x > y then y BT-Us would die in one minute.
Doctor Guan has made a program to determine how many BT-Us and BT-Vs survive when putting x BT-Us and y BT-Vs together.Program is as follow :
#include
ifstream filein(“reprog.in”);
ofstream fileout(“reprog.out”);
int main(){
long x,y;
for(;;){
filein>>x>>y;
if(x
时间限制:1000ms 内存限制:65535k
总提交数:54 正确:24
问题描述:
最近,关博士发现了两种新细菌并且命名为BT-U和BT-V.BT-U和BT-V非常特别,它们只能共生,关博士用BT-U和BT-V做了几个试验,结果如下:
将100个BT-U和80个BT-V放在一起,1分钟后,剩下20个BT-U和80个BT-V,2分钟后(又过了一分钟),剩下20个BT-U和60个BT-V,3分钟后(又过一分钟),剩下20个BT-U和40个BT-V,4分钟后,剩下20个BT-U和20个BT-V,之后一直保持现状.
将3个BT-U和5个BT-V放在一起,一分钟后,剩下3个BT-U和2个BT-V,两分钟后,剩下1个BT-U和2个BT-V,3分钟后剩下1个BT-U和1个BT-V,之后一直保持该状态.
根据以上结果,关博士得到这样一个结论:当把X个BT-U和Y个BT-V放在一起时,如果X=Y,则不会发生变化,如果XY,则Y个BT-U将在一分钟内死亡.
关博士编写了一个程序来确定X个BT-U和Y个BT-V放在一起时,有多少个BT-U和BT-V可以存活.程序如下:(程序略)
但是这个程序并不能执行,关博士需要你来帮他完善这个程序.
输入:
有多组测试数据,每行数据有两个整数X和Y.
以两个0作为结束标志.
输出
每行一个结果
例如:
输入
2 2
1 1
0 0
输出
2
1