解题思路:
注意事项:
参考代码:
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int a = sc.nextInt(); int b = sc.nextInt(); int ans = 0; if(a >= 120) ans++; else { System.out.println("0"); continue; } int sum = a - 120 + b; if(sum >= 120) { ans ++; } else { System.out.println(ans); continue; } sum = sum - 120 + b; if(sum >= 120) { ans ++; } else { System.out.println(ans); continue; } sum = sum - 120 + b; if(sum >= 100) { ans ++; System.out.println(ans); } else { System.out.println(ans); } } } }
0.0分
1 人评分