求助Subtask #1
查看原帖
求助Subtask #1
1520036
YangTP楼主2024/10/21 20:33
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong(), b = sc.nextLong(), n = sc.nextLong(), sum = 0;
		int w = 1, d = 0;
		if(a == 0 || b == 0)
			System.out.println(0);
		while(true)
		{
			switch(w)
			{
			case 1:
			case 2:
			case 3:
			case 4:
			case 5:
				sum += a;break;
			case 6:
			case 7:
				sum += b;break;
			}
			d++;
			if(sum >= n)
				break;
			w = w % 7 + 1;
			}
			System.out.println(d);
	        sc.close();
		}
	}

求助佬Subtask #1过不去啊

2024/10/21 20:33
加载中...