一、题目链接
http://noi.openjudge.cn/ch0104/07/
二、解题思路
⑴ 幸运瓶盖数不少于10个或者鼓励瓶盖数不少于20个,则一定可以获奖,否则一定不能获奖。
三、程序代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int x = input.nextInt(); // 幸运瓶盖数
int y = input.nextInt(); // 鼓励瓶盖数
// 如果幸运瓶盖数不少于10个或者鼓励瓶盖数不少于20个,则输出1,否则输出0
System.out.print(x > 9 || y > 19 ? 1 : 0);
}
}