- using ConsoleApp1;
- using System;//程式庫呼叫
- using System.ComponentModel.DataAnnotations;
- using System.Linq.Expressions;
- using ABC.qq;
- class Program//負責一部分工作的人
- {
- static List<int> scores = new List<int> { 100, 100, 95, 95, 92, 91, 90, 100, 88, 88, 87, 87, 90, 91, 85, 80, 81, 82, 82, 89 };
- static void Main()
- {
- try
- {
- int socre=Convert.ToInt32(Console.ReadLine());
- //查找列表中與score相同的成績必製作一張列表出來
- List<int> finds = scores.FindAll(delegate (int s)
- {
- return s.Equals(socre);
- });
- Console.WriteLine(finds.Count.ToString());
- }catch
- {
- Console.WriteLine("error");
- }
- Console.ReadKey();
-
- }
- }
複製代碼 |