巅峰赛第6场
import java.util.*; public class Solution { public int solve (int a, int b, int n) { int x=a*b+b; int y=a; int m=0; while(y*m<=n-b){ m++; } return (m-1)*(a)+b; } }
#笔试题目#
import java.util.*; public class Solution { public int solve (int a, int b, int n) { int x=a*b+b; int y=a; int m=0; while(y*m<=n-b){ m++; } return (m-1)*(a)+b; } }
相关推荐