import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); for(int i = 0; i * a <= c; i++){ for(int j = 0; j * b <= c; j++){ if(i * a + j * b == c){ System.out.printf("Yes"); System.exit(0); } } } System.out.printf("No"); } }这题需要循环来写,都从0开始,开始凑,看能不能凑出结果。