赞
踩
4
代码
- #include<stdio.h>
-
- int main()
- {
- int v1,v2,t,s,l;
- int i,tl = 0,rl = 0;
- char count;
- scanf("%d%d%d%d%d",&v1,&v2,&t,&s,&l);
- int f = v1;
- for(i = 1 ; ; i ++)
- {
- if(rl - tl >= t && v1 > 0 )
- {
- v1 = 0;
- count ++;
- }
- if(count == s+1){count = 0;v1=f;}
- if(count > 0 )count ++;
- tl += v2;
- rl += v1;
- if(tl >= l && rl >= l)
- {
- printf("D\n%d\n",i);
- break;
- }else if(tl >= l)
- {
- printf("T\n%d\n",i);
- break;
- }else if(rl >= l)
- {
- printf("R\n%d\n",i);
- break;
- }
- }
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。