参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int m = scanner.nextInt(); int n = scanner.nextInt(); int x = scanner.nextInt(); int tili = 0; for(int i = x; i > 0; i--) { tili += n; if(tili >= m) { tili = m; n += tili / n; tili = 0; } } System.out.print(n); } }
0.0分
5 人评分