- 最後登錄
- 2024-5-5
- 在線時間
- 0 小時
- 註冊時間
- 2016-8-22
- 閱讀權限
- 20
- 精華
- 0
- UID
- 16624936
- 帖子
- 61
- 積分
- 49 點
- 潛水值
- 26910 米
| 成為伊莉的版主,你將獲得更高級和無限的權限。把你感興趣的版面一步步地發展和豐盛,那種滿足感等著你來嚐嚐喔。 本帖最後由 Josie_2016 於 2016-11-24 09:08 AM 編輯
第五題- int[] x1 = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- int[] x2 = new int[10] { 2, 4, 6, 8,10,12,14,16,18,20 };
- int[] y1 = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- int[] y2 = new int[10] { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
- int x = 5, y = 5;//點
- for (int i = 0; i < x1.Length; i++)
- {
- if (x > x1[i] && x < x2[i] && y > y1[i] && y < y2[i])
- {
- Console.WriteLine(i);
- }
- }
-
複製代碼 第六題- string input = Console.ReadLine();
- string[] temp = input.Split(new char[] { ' ', ';', ',' });
- string[] temp1 = temp.Distinct().ToArray();
- foreach (string s in temp1)
- {
- Console.WriteLine(s + "count:" + temp.Where(n => n == s).Count());
- }
複製代碼 ... |
|