1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| namespace Prac_9_06
{
/********************************/
/* */
/* 空欄1 */
/* IntroductionInfoクラスの定義 */
/* (【課題9-03】と同じ) */
/* */
/********************************/
internal class Program
{
static void Main(string[] args)
{
// 処理対象の配列(変更してはならない)
IntroductionInfo[] intros = new[]
{
new IntroductionInfo (){ StudentID = "HI022099", Name = "医療太郎", Motto = "一攫千金", Birthday = new DateTime(2003, 11, 4) },
new IntroductionInfo (){ StudentID = "HI024106", Name = "佐藤一馬", Motto = "因果応報", Birthday = new DateTime(2005, 11, 5) },
new IntroductionInfo (){ StudentID = "HI023095", Name = "川村裕子", Motto = "融通無碍", Birthday = new DateTime(2004, 11, 6) },
new IntroductionInfo (){ StudentID = "HI022105", Name = "田中一郎", Motto = "一期一会", Birthday = new DateTime(2003, 6, 10) },
new IntroductionInfo (){ StudentID = "HI021111", Name = "北村健人", Motto = "天衣無縫", Birthday = new DateTime(2002, 5, 19) },
new IntroductionInfo (){ StudentID = "HI022098", Name = "下原裕介", Motto = "終始如一", Birthday = new DateTime(2004, 2, 10) },
new IntroductionInfo (){ StudentID = "HI023116", Name = "山崎康介", Motto = "有言実行", Birthday = new DateTime(2004, 9, 7) },
new IntroductionInfo (){ StudentID = "HI021104", Name = "医療花子", Motto = "質実剛健", Birthday = new DateTime(2003, 3, 12) },
new IntroductionInfo (){ StudentID = "HI024090", Name = "上村理恵", Motto = "挙一反三", Birthday = new DateTime(2006, 1, 10) },
new IntroductionInfo (){ StudentID = "HI023101", Name = "山田太郎", Motto = "日々平穏", Birthday = new DateTime(2004, 4, 1) },
new IntroductionInfo (){ StudentID = "HI022107", Name = "藤原弓子", Motto = "切磋琢磨", Birthday = new DateTime(2003, 7, 27) },
new IntroductionInfo (){ StudentID = "HI022091", Name = "一宮花子", Motto = "一月三舟", Birthday = new DateTime(2004, 3, 2) },
new IntroductionInfo (){ StudentID = "HI021113", Name = "中村次郎", Motto = "奇々怪々", Birthday = new DateTime(2002, 12, 1) },
new IntroductionInfo (){ StudentID = "HI022109", Name = "西村雄太", Motto = "臥薪嘗胆", Birthday = new DateTime(2003, 10, 11) },
new IntroductionInfo (){ StudentID = "HI024108", Name = "東堂和子", Motto = "晴耕雨読", Birthday = new DateTime(2005, 9, 30) },
new IntroductionInfo (){ StudentID = "HI023092", Name = "土屋浩三", Motto = "自由自在", Birthday = new DateTime(2004, 4, 18) },
new IntroductionInfo (){ StudentID = "HI022110", Name = "南原孝行", Motto = "夷険一節", Birthday = new DateTime(2003, 4, 22) },
new IntroductionInfo (){ StudentID = "HI023097", Name = "風間正子", Motto = "孤軍奮闘", Birthday = new DateTime(2005, 3, 22) },
new IntroductionInfo (){ StudentID = "HI021099", Name = "内海庄司", Motto = "泰然自若", Birthday = new DateTime(2002, 6, 11) },
new IntroductionInfo (){ StudentID = "HI022102", Name = "岩鬼正美", Motto = "豪放磊落", Birthday = new DateTime(2004, 1, 1) },
};
var query = /********************************************/
/* */
/* 空欄2 */
/* 配列 intros から LINQ を用いて */
/* 設問に示された条件の要素を絞り込む. */
/* */
/********************************************/
;
// 表示処理(変更してはならない)
foreach(var ii in query)
{
Console.WriteLine($"{ii.StudentID} : {ii.Name}({ii.Birthday:yyyy-MM-dd})「{ii.Motto}」");
}//foreach
}// end of Main()
}// end of class
}// end of namespace
|