using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace JiFen{ class PRogram { static void Main(string[] args) { int[] points = new int[5]; //歷年積分數(shù)組 int[] newPoints = new int[5]; //新年積分數(shù)組 Console.WriteLine("請輸入五位會員的積分:"); for (int i = 0; i < points.Length; i++) { Console.WriteLine("第" + (i + 1) + "位會員積分"); points[i] =Convert.ToInt32(Console.ReadLine()); } //數(shù)組復制 for (int i = 0; i < points.Length; i++) { newPoints[i] = points[i]; newPoints[i] = newPoints[i] + 500; //贈送500積分 } Console.WriteLine("/n序號 歷史積分 新年積分"); for (int i = 1; i < points.Length; i++) { Console.WriteLine("/n" + (i + 1) + "/t" + points[i] + "/t" + newPoints[i]); } Console.ReadLine(); } }}
新聞熱點
疑難解答