import java.util.Scanner; public class A02 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); System.out.println("MyShoPing管理系统>客户信息管理>添加客户信息\n"); int No = 0; String Birthday = ""; int integral = 0; for (int i = 0; i < 3; i++) { System.out.print("请输入会员号<4位整数>:"); No = input.nextInt(); System.out.print("请输入会员生日(月/日<用两位整数表示>):"); Birthday = input.next(); System.out.print("请输入会员积分:"); integral = input.nextInt(); if (No < 1000 || No > 9999) { System.out.println("客户号" + No + "是无效的会员!"); System.out.println("录入信息失败!"); continue; } System.out.println("您录入的会员信息是:"); System.out.println(No + "\t" + Birthday + "\t" + integral); } System.out.println("\n程序结束!"); } }
java-第六章-for-循环录入会员信息,布布扣,bubuko.com
原文地址:http://1797077217.blog.51cto.com/8956560/1420820