import java.util.Scanner; public class A05 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); System.out.println("请输入5位会员的积分:"); int integral[] = new int[5]; for (int i = 0; i < integral.length; i++) { System.out.print("请输入第" + (i + 1) + "位会员的积分:"); integral[i] = input.nextInt(); } System.out.println("\n序号\t历史积分\t新年积分"); for (int i = 0; i < integral.length; i++) { System.out.println((i + 1) + "\t" + integral[i] + "\t" + (integral[i] + 500)); } } }
java-第七章-数组-更新会员积分
时间: 2024-10-15 03:02:22