当前位置: 代码迷 >> 综合 >> HDOJ 1555 How many days?
  详细解决方案

HDOJ 1555 How many days?

热度:34   发布时间:2023-10-21 19:14:53.0

HDACM 1555

水题

import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);while (sc.hasNext()) {int m = sc.nextInt();int k = sc.nextInt();if (m==0&&k==0) {break;}int t = 0;int i = 0;while (m>0) {t++;i++;m--;if (i==k) {m++;i=0;}}System.out.println(t);}sc.close();}
}
  相关解决方案