package text; import java.util.Scanner; public class Jiejue4 { public static void main(String[] args) { // TODO Auto-generated method stub 2.输入一个4位会员卡号,如果百位数字是3的倍数,就输出是幸运会员,否则就输出不是.
Scanner input = new Scanner(System.in); System.out.println("请输入四位会员卡号"); int number= input.nextInt(); int a= number/100%10; for( a=0;a<10;a++) { if(a%3==0) { System.out.println("幸运会员"); } else System.out.println("继续加油"); } } }