您的位置:首页 > 其它

ZOJ-1494

2013-12-16 11:28 183 查看
import java.util.Scanner;

public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);

while (true)
{
int n = sc.nextInt();

if (n == 0)
break;

int u = sc.nextInt();
int d = sc.nextInt();

int minutes = 0;
int total = 0;

while (true)
{
total += u;
minutes++;

if (total >= n)
break;

total -= d;
minutes++;
}
System.out.println(minutes);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: