- using ConsoleApp1;
- using System;//程式庫呼叫
- using System.ComponentModel.DataAnnotations;
- using System.Linq.Expressions;
- using ABC.qq;
- class Program//負責一部分工作的人
- {
- static void Main()
- {
- try
- {
- List<string> lst = new List<string>();
- string str = "";
- while (true)
- {
- str = Console.ReadLine();
- if (str != "999")
- {
- lst.Add(str);
- }
- else
- {
- break;
- }
-
- }
- compute(lst);
- } catch
- {
- Console.WriteLine("error");
- }
- Console.ReadKey();
-
- }
- static void compute(List<string> lst)
- {
- Console.WriteLine("before:"+String.Join(" ",lst));
- lst.Reverse();
- Console.WriteLine("afer:" + String.Join(" ", lst));
- }
-
- }
複製代碼 |