package 本章总结;import java.util.Scanner;public class A04 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); for (int i = 0; i < 3; i++) { System.out.println("请输入密码:"); int pwd = in.nextInt(); if (pwd == 111111) { System.out.println("请输入取款的金额:"); int amount = in.nextInt(); for (int j = 0; j < 100; j++) { if (amount % 100 == 0 && amount <= 1000) { System.out.println("您取了" + amount + "元"); System.out.println("交易完成!请取卡!"); return; } else { System.out.println("您输入的金额不合法!请重新输入:"); amount = in.nextInt(); continue; } } } } System.out.println("密码错误!请取卡!"); }}