Microsoft Word - CPMidTerm2012SpringSolution

Size: px
Start display at page:

Download "Microsoft Word - CPMidTerm2012SpringSolution"

Transcription

1 通識計算機程式設計期中考參考解答, 4/20/ 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) int k; bool b; double x; (b) 在螢幕顯示一行字, 要求使用者輸入一個浮點數 (3%) Console.WriteLine(" 輸入一個浮點數 "); (c) 自鍵盤讀入一個浮點數, 並將其值存入已宣告之 double 變數 x (3%) x = double.parse(console.readline()); (d) 將已宣告設值之 double 變數 x 強制轉型為整數, 存入已宣告之 int 變數 k (3%) k = (int)x; (e) 令已宣告之 bool 變數 b 等於關係式 k>0 (3%) b = (k > 0); 2. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 只用一個敘述, 將已宣告設值之 int 變數 a 設值 (assign) 給他處已宣告之 int 變數 b, 再以遞增算子將 a 加 1 (3%) int b = a++; (b) 宣告 bool 變數 r, 並設其值為 p 且 (and) ( 非 q) 之邏輯演算的結果 bool 變數 P 與 q 均已於他處宣告設值 (3%) 1/19

2 bool r = p & (!q); (c) 宣告 double 變數 y, 並令其值為他處已宣告設值之 double 變數 t 與 2 之積加上一個他處已宣告設值之 double 變數 phi 之後的正弦函數 (sine) 值 ( 數學上即 y sin( 2 t phi) ), 注意此處 為圓周率 (3%) double y = Math.Sin(2.0 Math.PI t + phi); (d) 宣告 double 變數 heaviside, 利用三元運算子使其在他處已宣告設值之 double 變數 x 大於等於 0 時,heaviside 等於 1.0, 反之則 heaviside 等於 0.0 (3%) double heaviside = (x >= 0)? 1.0 : 0.0; (e) 宣告變數 c 為 char 型別, 並令其值為 換行 (new line) 字元 (3%) char c = '\n'; 3. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告一個亂數產生器物件 rand, 讓系統以時間和網路卡號自動決定種子數 (3%) Random rand = new Random(); 4 (b) 宣告一個 int 二維陣列 , 命名為 a, 用迴圈計算左上到右下 6 對角線三元素的和, 存入 int 變數 sum (3%) int[,] a = 4, 9, 2, 3, 5, 7, 8, 1, 6 ; int i; const int N = 3; int sum = 0; for (i = 0; i < N; ++i) sum += a[i, i]; 2/19

3 (c) 寫一個無窮迴圈, 迴圈中讀入一個整數, 讀到一個負整數時跳出迴圈, 否則繼續 (3%) int i; for (; ; ) // 亦可用 while (true) i = int.parse(console.readline()); if (i < 0) break; (d) 利用 Console.ReadLine().ToCharArray() 將讀入之字串轉為字元陣列 s, 並用以分設字串第一個字元和最後一個字元為 char 變數 cfirst 與 clast (3%) char[] s = Console.ReadLine().ToCharArray(); char cfirst = s[0]; char clast = s[s.length - 1]; //char clast = s[s.getupperbound(0)]; 亦可 (e) 寫一個 void 函數 ComputeCubeVolumeAndSurfaceArea, 傳入一個立方體的邊長, 傳回此立方體的體積 ( 邊長的立方 ) 和表面積 (6 乘以邊長的平方 ) 再寫一段程式敘述, 呼叫此函數, 計算邊長為 2 的立方體體積和表面積 (3%) static void ComputeCubeVolumeAndSurfaceArea( double side, out double volume, out double surfacearea) volume = sidesideside; surfacearea = 6sideside; double volume; double surfacearea; ComputeCubeVolumeAndSurfaceArea(2.0, out volume, out surfacearea); 或 3/19

4 static void ComputeCubeVolumeAndSurfaceArea( double side, ref double volume, ref double surfacearea) volume = side side side; surfacearea = 6 side side; double volume = 0.0; double surfacearea = 0.0; ComputeCubeVolumeAndSurfaceArea(2.0, ref volume, ref surfacearea); 4. 找出以下程式片段之錯誤, 並予更正., 使其中的 Debug.Assert 敘述 ( 若有的話 ) 成立無誤 (a) (3%) int m = 5; int q = m++; Debug.Assert(q == 6); 原程式片段 m 先設給 q 後才加 1, 所以應改為 int m = 5; int q = ++m; Debug.Assert(q == 6); 或 int m = 6; int q = m++; Debug.Assert(q == 6); (b) (3%) enum Status INSIDE, OUTSIDE Status s = INSIDE; 4/19

5 enum Status INSIDE, OUTSIDE Status s = Status.INSIDE; (c) (3%) 累加 1 到 100 int sum = 0; int n = 1; while (n <= 100) sum += n; ; Debug.Assert(sum == 5050); 迴圈中沒有改變 n 值, 成為無窮迴圈 所以應改為 int sum = 0; int n = 1; while (n <= 100) sum += n; ++n; ; Debug.Assert(sum == 5050); (d) (3%) 呼叫 void 函式 Triple, 使 a 變成原值的三倍 int a = 3; Triple(a); Debug.Assert(a==9); static void Triple(int a) a = 3; 5/19

6 此為傳值函式, 不改變原來的真實參數 a, 因此需改為傳址函式 int a = 3; Triple(ref a); Debug.Assert(a == 9); static void Triple(ref int a) a = 3; (e) (3%) 下列程式片段不應影響陣列 x, 且更正時不能改變敘述 y[1]=4; int[] x = 2, 1, 2, 5, 3 ; int[] y = x; y[1] = 4; Debug.Assert(x[1] == 1); y = x 使兩陣列記憶區域相同,y 元素的任何改變均會影響到 x 應改為 int[] x = 2, 1, 2, 5, 3 ; int[] y = new int[x.length]; Array.Copy(x, y, x.length); y[1] = 4; Debug.Assert(x[1] == 1); 5. 試寫出下列程式的輸出 (5%) using System; namespace CPMidTerm2012Problem5 class Program static void Main(string[] args) int[] x = 2, 1, 2, 5, 3 ; foreach( int element in x ) 6/19

7 Console.Write(element+"\t"); Console.WriteLine(); Array.Reverse(x); foreach (int element in x) Console.Write(element + "\t"); Console.WriteLine(); Array.Sort(x); foreach (int element in x) Console.Write(element + "\t"); Console.WriteLine(); int idx = Array.IndexOf(x, 2); Console.WriteLine(idx); idx = Array.LastIndexOf(x, 2); Console.WriteLine(idx); 6. 試寫出下列程式的輸出 (10%) using System; namespace CPMidTerm2012Problem6 class Program 7/19

8 static void Main(string[] args) int[] x = 2, 1, 2, 5, 3 ; int y = 0; const int N = 5; int n; Console.WriteLine("y[0] = " + y); int xcurrent; int xprevious; int yprevious; for (n = 1; n < N; ++n) xcurrent = x[n]; xprevious = x[n - 1]; yprevious = y; y = IIR(xCurrent, xprevious, yprevious); Console.WriteLine("y[0] = 1", n, y); static int IIR(int xcurrent, int xprevious, int yprevious) int y = 2 xcurrent + xprevious + yprevious; return y; 8/19

9 7. 踩地雷 是微軟 Windows 作業系統所附的小遊戲, 許多人都玩過 本題要求寫一個簡化版的踩地雷遊戲, 規則如下 : 棋盤由 9X9 的方格組成, 電腦先隨機於其中 10 個方格佈下地雷, 使用者隨後不停任意翻開方格 直到遇見地雷, 遊戲即告結束, 使用者得分即遇到地雷前翻開的方格總數 所寫程式的主控台螢幕, 開始時如下圖 : 使用者輸入座標, 代表要翻的方格位置 若沒碰到地雷, 清除螢幕, 重新顯示棋盤及得分 假設使用者翻開第 0 列第 0 行方格, 且未遇地雷, 則畫面顯示如下 : 9/19

10 圖中可見翻出之方格以圈號表示, 並秀出得 1 分 如此反覆進行, 直到遇見地雷, 遊戲結束, 主控台螢幕顯示所有地雷 ( 以星號表出 ) 及已 未翻方格與得分 一種可能畫面如下 : 你可以使用下列已準備好的函式 ( 也可以不用而自行撰寫 ): 10/19

11 // 顯示棋盤及得分 // 參數說明 : // board 代表棋盤 // ix, jx 分別代表 10 顆地雷在棋盤中的列和行座標構成的一維陣列 // 其元素例如 ix[5] = 3,jx[5] = 2 表示第 6 顆地雷位在 board[3,2] // score 代表使用者得分 // gameover 代表遊戲是否已經結束 static void Display(char[,] board, int[] ix, int[] jx, int score, bool gameover) int m; int i; int j; if (gameover) for (m = 0; m < 10; ++m) board[ix[m], jx[m]] = ''; Console.Write(" 列 / 行 \t"); for (j = 0; j < 9; ++j) Console.Write(" 0 ", j); Console.WriteLine(); Console.Write("\t"); for (j = 0; j < 9; ++j) Console.Write("+---"); Console.WriteLine("+"); for (i = 0; i <9; ++i) Console.Write("0\t",i); for (j = 0; j < 9; ++j) Console.Write(" 0 ", board[i, j]); 11/19

12 Console.WriteLine(" "); Console.Write("\t"); for (j = 0; j < 9; ++j) Console.Write("+---"); Console.WriteLine("+"); Console.WriteLine(); Console.WriteLine(" 得分 : 0", score); 上列函式可直接在答案中引用, 不需重抄一遍 此處使用陣列為參數, 可以先不必考慮傳值或傳址, 直接以主程式中的對應陣列作為真實參數呼叫即可 能利用虛擬碼思考, 並有適當註解, 才可得本題滿分 25 分 (25%) / CPMidTerm2012Problem7 踩地雷簡易版 skj 4/16/2012 虛擬碼 棋盤 board[0,0]~board[8,8] 列 / 行 /19

13 得分 : 0 1. 放置 10 枚地雷 2. 得分設為 0 3. do 3.1 顯示棋盤及分數 3.2 使用者輸入欲翻方格的位置 (i0, j0) 3.3 if( 有地雷 ) break 3.4 累加得分 3.5 (i0, j0) 方格設為 'o' while( 仍有空格 ) 4. 顯示棋盤及得分 放置地雷虛擬碼 列 / 行 /19

14 設第 m 個地雷的列與行分為 ix[m] 及 jx[m] for(m=0 到 9) do 產生一個 0 到 80 之間的亂數 r[m] 檢查此亂數是否出現過 while( 亂數未出現過 ) ix[m] = r[m]/9 jx[m] = r[m]%9 虛擬碼 : 檢查 (i0, j0) 處是否有地雷 檢查 i0 是否在 ix 中 檢查 j0 是否在 jx 中 如果二者均是, 且所在索引相同, 使用者即已觸雷 / using System; namespace CPMidTerm2012Problem7 class Program 14/19

15 static void Main(string[] args) int[] ix = new int[10]; int[] jx = new int[10]; PlaceMines(ix, jx); int score = 0; bool gameover = false; char[,] board = new char[9, 9]; int i; int j; for (i = 0; i < 9; ++i) for (j = 0; j < 9; ++j) board[i, j] = ' '; bool hasvacancies = true; do Console.Clear(); Display(board, ix, jx, score, gameover); // 使用者輸入欲翻方格的位置 Console.WriteLine(); Console.Write(" 輸入欲翻方格的座標, 以逗點分隔 : "); string[] input = new string[2]; input = Console.ReadLine().Split(','); int io = Convert.ToInt16(input[0]); int jo = Convert.ToInt16(input[1]); gameover = TouchedAMine(io, jo, ix, jx); if (gameover) break; ++score; 15/19

16 board[io, jo] = 'o'; hasvacancies = HasVacancies(board); while (hasvacancies); gameover = true; Console.Clear(); Display(board, ix, jx, score, gameover); Console.WriteLine(" 遊戲結束 "); // 放置地雷 static void PlaceMines(int[] ix, int[] jx) int[] r = new int[10]; Random rand = new Random(); int m; int i; for (m = 0; m < 10; ++m) bool used = false; do r[m] = rand.next() % 81; // 檢查是否與之前位置重複 for (i = 0; i < m; ++i) if (r[m] == r[i]) used = true; break; while (used); ix[m] = r[m] / 9; jx[m] = r[m] % 9; 16/19

17 // 顯示棋盤及得分 // 參數說明 : // board 代表棋盤 // ix, jx 分別代表 10 顆地雷在棋盤中的列和行座標構成的一維陣列 // 其元素例如 ix[5] = 3,jx[5] = 2 表示第 6 顆地雷位在 board[3,2] // score 代表使用者得分 // gameover 代表遊戲是否已經結束 static void Display(char[,] board, int[] ix, int[] jx, int score, bool gameover) int m; int i; int j; if (gameover) for (m = 0; m < 10; ++m) board[ix[m], jx[m]] = ''; Console.Write(" 列 / 行 \t"); for (j = 0; j < 9; ++j) Console.Write(" 0 ", j); Console.WriteLine(); Console.Write("\t"); for (j = 0; j < 9; ++j) Console.Write("+---"); Console.WriteLine("+"); for (i = 0; i <9; ++i) 17/19

18 Console.Write("0\t",i); for (j = 0; j < 9; ++j) Console.Write(" 0 ", board[i, j]); Console.WriteLine(" "); Console.Write("\t"); for (j = 0; j < 9; ++j) Console.Write("+---"); Console.WriteLine("+"); Console.WriteLine(); Console.WriteLine(" 得分 : 0", score); static bool TouchedAMine(int io, int jo, int[] ix, int[] jx) int idxi = Array.IndexOf(ix, io); int idxj = Array.IndexOf(jx, jo); bool result = (idxi >= 0 && idxj >= 0 && idxi == idxj); return result; // 檢查是否仍有空白 static bool HasVacancies(char[,] board) bool hasvacancies = false; for (int i = 0; i < 9; ++i) for (int j = 0; j < 9; ++j) if (board[i, j] == ' ') hasvacancies = true; 18/19

19 break; return hasvacancies; 19/19

Microsoft Word - CPMidTerm2010SpringSolution

Microsoft Word - CPMidTerm2010SpringSolution 通識計算機程式設計期中考參考解答, 4/23/2010 1. (a) 宣告 double 變數 z, bool 變數 b, int 變數 i (3%) 答 : double z; bool b; (b) 在螢幕顯示一行字, 要求使用者輸入一個浮點數. (3%) 答 : Console.WriteLine(" 輸入一個浮點數 "); (c) 自鍵盤讀入一個浮點數., 並將其值存入已宣告之 double

More information

Microsoft Word - CPMidTerm2011Spring

Microsoft Word - CPMidTerm2011Spring 通識計算機程式設計期中考試題, 4/22/2011 共 8 頁, 滿分 100 分 1. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) (b) 在螢幕顯示一行字, 要求使用者輸入一個整數 (3%) (c) 自鍵盤讀入一個整數., 並將其值存入已宣告之

More information

Microsoft Word - CPMidTerm2011SpringSolution

Microsoft Word - CPMidTerm2011SpringSolution 通識計算機程式設計期中考參考解答, 4/22/2011 1. (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) 答 : int k; bool b; double x; (b) 在螢幕顯示一行字, 要求使用者輸入一個整數 (3%) 答 : Console.WriteLine(" 輸入一個整數 "); (c) 自鍵盤讀入一個整數., 並將其值存入已宣告之 int

More information

Object-Oriented Programming, Mid-term Test, 11/21/2000

Object-Oriented Programming, Mid-term Test, 11/21/2000 通識計算機程式設計期中考試題參考解答, 4/17/2009 1. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 x, bool 變數 b, double 常數 F = 7.0. (3%) int x; bool b; const double F = 7.0; (b) 在螢幕顯示一行字, 要求使用者輸入一個整數.

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

More information

untitled

untitled 1 Outline 流 ( ) 流 ( ) 流 ( ) 流 ( ) 流 ( ) 狀 流 ( ) 利 來 行流 if () 立 行 ; else 不 立 行 ; 例 sample2-a1 (1) 列 // 料 Console.Write(""); string name = Console.ReadLine(); Console.WriteLine(" " + name + "!!"); 例 sample2-a1

More information

CHAPTER VC#

CHAPTER VC# 1. 2. 3. 4. CHAPTER 2-1 2-2 2-3 2-4 VC# 2-5 2-6 2-7 2-8 Visual C# 2008 2-1 Visual C# 0~100 (-32768~+32767) 2 4 VC# (Overflow) 2-1 2-2 2-1 2-1.1 2-1 1 10 10!(1 10) 2-3 Visual C# 2008 10! 32767 short( )

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

untitled

untitled 1 Outline ArrayList 類 列類 串類 類 類 例 理 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object

More information

untitled

untitled 1 Outline 類别 欄 (1) 類 類 狀 更 易 類 理 若 類 利 來 利 using 來 namespace 類 ; (2) namespace IBM class Notebook namespace Compaq class Notebook 類别 類 來 類 列 欄 (field) (property) (method) (event) 類 例 立 來 車 類 類 立 車 欄 料

More information

untitled

untitled 1 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object 參 類 都 object 參 object Boxing 參 boxing

More information

CHAPTER 1

CHAPTER 1 CHAPTER 1 1-1 System Development Life Cycle; SDLC SDLC Waterfall Model Shelly 1995 1. Preliminary Investigation 2. System Analysis 3. System Design 4. System Development 5. System Implementation and Evaluation

More information

Microsoft Word - CPFinal2010Spring

Microsoft Word - CPFinal2010Spring 通識計算機程式設計期末考試題, 6/25/2010 共 12 頁, 滿分 100 分外加最多 4 分 1. 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 撰寫類別程式 Rhombus 代表菱形, 其中宣告私有 double 變數 d1 d2, 分別代表兩互相垂直的對角線長, 另有建構式設定 d1 d2 之值, 屬性 D1 D2 分別傳回與設定

More information

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1 C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 月 3 日 1 1 INPUTOUTPUT 1 InputOutput 题目描述 用 cin 输入你的姓名 ( 没有空格 ) 和年龄 ( 整数 ), 并用 cout 输出 输入输出符合以下范例 输入 master 999 输出 I am master, 999 years old. 注意 "," 后面有一个空格,"." 结束,

More information

第3章.doc

第3章.doc 3 3 3 3.1 3 IT Trend C++ Java SAP Advantech ERPCRM C++ C++ Synopsys C++ NEC C C++PHP C++Java C++Java VIA C++ 3COM C++ SPSS C++ Sybase C++LinuxUNIX Motorola C++ IBM C++Java Oracle Java HP C++ C++ Yahoo

More information

<4D F736F F D DA5BFA6A1C476C1C92DBEC7ACECB8D5A8F728B57BB35D292E646F63>

<4D F736F F D DA5BFA6A1C476C1C92DBEC7ACECB8D5A8F728B57BB35D292E646F63> 全國高級中等學校 106 學年度商業類科學生技藝競賽 程式設計 職種 學科 試卷 選手證號碼 ( 崗位編號 ): 姓名 : 注意事項 : 請將答案劃記於答案卡, 未依規定劃記者不予計分 試題說明 :( 選擇題共 25 題每題 4 分, 答錯不倒扣, 共 100 分 ) ( )1. 執行以下 Visual Basic 程式片段, 其結果為何?(A) 15 (B) 12 (C) 7 (D) 3 Dim

More information

新・解きながら学ぶJava

新・解きながら学ぶJava 481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --

More information

119,,,,,, (, ), : (1),,,,,, (2),,,, (3),,,,,20,,,,,,,,

119,,,,,, (, ), : (1),,,,,, (2),,,, (3),,,,,20,,,,,,,, 118 :,,, :,,,,,,,,,,,,,,, ( ), 119,,,,,, (, ), : (1),,,,,, (2),,,, (3),,,,,20,,,,,,,, 120 2003 3,19,,,,,,,,,,,,,,,,,,,,,,,,,, 1945 10 15,, 121, 1950,, 1951 7 10, 1952 7 11,,, 60,, 1947 3,,,, 1950 6,7,,,,,,,,

More information

Microsoft Word - C-pgm-ws2010.doc

Microsoft Word - C-pgm-ws2010.doc Information and Communication Technology 資訊與通訊科技 Loops (while/for) C 廻路 姓名 : 班別 : ( ) CS C Programming #1 Functions 函數 : 1 若 n=14, 求以下表示式的值 Expressions 表示式 Value 值 Expressions 表示式 Value 值 A 20 2 * (n /

More information

第1章

第1章 第 8 章 函式 1 本章提要 8.1 前言 8.2 如何定義函式 8.3 函式的呼叫和返回 8.4 傳遞陣列 8.5 方法多載 8.6 遞迴 8.7 綜合練習 8.8 後記 2 8.1 前言 每一種高階程式語言都有提供函式 (Function)( 或稱函數 ) 的功能, 以便將經常使用到的程式功能包裝成函式的形式, 如此一來便能反覆地呼叫該函式來完成某件特定工作在高階程式語言中, 副程式 (Subroutine)

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2 Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

Microsoft PowerPoint - Class2.pptx

Microsoft PowerPoint - Class2.pptx C++ 程式初探 II 2015 暑期 C++ 程式 II 大綱 1. 變數 2. 運算式 3. 輸出 4. 條件判斷 5. 迴圈 6. 陣列 2 基本變數型態 整數 位元組 浮點數 位元組 字元 位元組 short 2 float 4 char ( 整數 ) 1 int 2 (4) double 8 long 4 (8) long double 8(10) 位元組 整數値域 浮點數値域 準確度 1-128

More information

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class 踩地雷遊戲 高慧君南港高中 開啟專案 MineSweep 任務一 : 產生 30X20 個磚塊編輯 Table 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.arraylist; Write a description of class MyWorld

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

<4D F736F F D B0D3B77EC3FEA7DEC3C0C476C1C9A5BFA6A1B8D5C3442DB57BA6A1B35DAD702DBEC7ACEC2E646F6378>

<4D F736F F D B0D3B77EC3FEA7DEC3C0C476C1C9A5BFA6A1B8D5C3442DB57BA6A1B35DAD702DBEC7ACEC2E646F6378> 全國國高級中中等學校 105 學年度商商業類學學生技藝藝競賽 程式式設計 職職種 學學科 試試卷 崗位位編號 : 姓名 : 注意事項 : 請將答案案劃記於答案案卡, 未依依規定劃記者者不予計分分 試題說明 :( 選擇題每每題 4 分, 共 100 分 ) ( )1. 執行以下 Visual Basic 程式片段, 其結果為何?(A) 15 Dim i As Byte i = &HFC Console.WriteLine(Not

More information

Microsoft Word - CPFinal2012Spring

Microsoft Word - CPFinal2012Spring 通識計算機程式設計期末考試題, 6/22/2012 共 13 頁, 滿分 100 分外加最多 4 分 1. 參考下一頁的 UML 類別圖, 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ), 均不需處理例外情況 (a) 撰寫結構 Point, 包含兩個公有 int 變數 x y, 代表點座標 (x,y) 另寫正規建構式分別設定 x y 之值 (3%)

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

Microsoft PowerPoint - 12 struct and other datatypes.ppt

Microsoft PowerPoint - 12 struct and other datatypes.ppt 第十一章結構與其它資料型態 結構與巢狀結構 結構陣列的各種使用方法 列舉型態 自定的型態別名 typedef 認識結構 使用者自定的資料型態 結構可將型態不同的資料合併成為新的型態 定義結構與宣告結構變數的格式如下 : struct 結構名稱 資料型態成員名稱 1; 資料型態成員名稱 2;... 資料型態成員名稱 n; struct 結構名稱變數 1, 變數 2,, 變數 n; 定義結構與宣告結構變數的語法

More information

Microsoft PowerPoint - ch1.pptx

Microsoft PowerPoint - ch1.pptx 1 變數 資料型別 變數宣告及使用 型別轉換 運算子 常數 列舉型別 結構型別 亂數 課後練習 2 何謂變數 變數 是用來請電腦幫忙記住某些我們需要的東西 變數宣告 變數在使用之前, 必須先告訴電腦要預先準備多大的空間來存放這個變數的內容, 這樣的步驟稱之為 宣告 資料型別 利用 資料型別 來描述所需要的空間大小 3 開頭第一個字必須為 A Z a z 或 _ ( 底線 ) 不允許數字 0 9 當做變數的開頭

More information

untitled

untitled 1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart

More information

untitled

untitled How to using M-Power Report API M-Power Report API 力 了 M-Power Report -- Java (Library) M-Power Report API 行 Java M-Power Report M-Power Report API ( 30 ) PDF/HTML/CSV/XLS JPEG/PNG/SVG 料 料 OutputStream

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++

More information

第一章 章标题-F2 上空24,下空24

第一章 章标题-F2 上空24,下空24 2 C# C# C#.NET ASP.NET C# C# C# 2.1 C# C#.NET.NET C#.NET C# CLR C#.NET 2.1.1 C# C# C++ Visual Basic C# C++ C++ C# C#.NET C# C C++ C#. C# C# C# C# 2.1.2 C# C# 2-01.cs C# 2-01.cs class Hello{ public static

More information

全國各級農會第 2 次聘任職員統一考試試題 科目 : 程式設計類別 : 九職等以下新進人員作答注意事項 : 1 全部答案請寫在答案卷內, 如寫在試題紙上, 則不予計分 2 請以黑色或藍色鋼筆或原子筆書寫, 並以橫式書寫 ( 由左至右, 由上而下 ) 一 選擇題 ( 每題 4 分, 共 40 分 )

全國各級農會第 2 次聘任職員統一考試試題 科目 : 程式設計類別 : 九職等以下新進人員作答注意事項 : 1 全部答案請寫在答案卷內, 如寫在試題紙上, 則不予計分 2 請以黑色或藍色鋼筆或原子筆書寫, 並以橫式書寫 ( 由左至右, 由上而下 ) 一 選擇題 ( 每題 4 分, 共 40 分 ) 全國各級農會第 2 次聘任職員統一考試試題 一 選擇題 ( 每題 4 分, 共 40 分 ) 1. 在 Java 語言中, 請問下列何者資料型別的變數, 所需的儲存空間最少? (a) char (b) float (c) double (d) int 2. 請問下列何者非 C 語言的關鍵字 (key word)? (a) const (b) default (c) dynamic (d) continue

More information

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

More information

Microsoft Word - ch04三校.doc

Microsoft Word - ch04三校.doc 4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear

More information

840 提示 Excel - Excel -- Excel (=) Excel ch0.xlsx H5 =D5+E5+F5+G5 (=) = - Excel 00

840 提示 Excel - Excel -- Excel (=) Excel ch0.xlsx H5 =D5+E5+F5+G5 (=) = - Excel 00 Excel - - Excel - -4-5 840 提示 Excel - Excel -- Excel (=) Excel ch0.xlsx H5 =D5+E5+F5+G5 (=) = - Excel 00 ( 0 ) 智慧標籤 相關說明提示 -5 -- Excel 4 5 6 7 8 + - * / % ^ = < >= & 9 0 (:) (,) ( ) Chapter - :,

More information

C/C++语言 - 运算符、表达式和语句

C/C++语言 - 运算符、表达式和语句 C/C++ Table of contents 1. 2. 3. 4. C C++ 5. 6. 7. 1 i // shoe1.c: # include # define ADJUST 7. 64 # define SCALE 0. 325 int main ( void ) { double shoe, foot ; shoe = 9. 0; foot = SCALE * shoe

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

第 42 卷 第 5 期 2012 年 9 月 浙 江 大 学 学 报 人文社会科学版 Journal of Zhejiang University Humanities and Social Sciences V ol 42 N o 5 Sept 2012 DOI 10 3785 j issn 1008 942X 2012 04 052 亚当 斯密和文明社会的四个隐喻 张国清 张翼飞 浙江大学 公共管理学院

More information

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP:  ******************* * 关于 Java 测试试题 ****** ******************* * 关于 Java 测试试题 ******************* 問 1 运行下面的程序, 选出一个正确的运行结果 public class Sample { public static void main(string[] args) { int[] test = { 1, 2, 3, 4, 5 ; for(int i = 1 ; i System.out.print(test[i]);

More information

Microsoft Word - 04_object_Boxing_property_indexer.doc

Microsoft Word - 04_object_Boxing_property_indexer.doc C# 程式設計人員參考 object 型別是.NET Framework 中,System.Object 的別名 您可以將 任何型別的值指派給 object 型別的變數 所有的資料型別, 包括預先定義的和使用者定義的, 都繼承自 System.Object 類別 object 資料型別是物件 Box 目標或來源的型 別 範例下列範例顯示 object 型別的變數如何接受任何資料型別的值, 以及 object

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

<313031A4C9BEC7C160BA5DB3E62831303130383135A457BAF4A4BDA769AAA9292E584C53>

<313031A4C9BEC7C160BA5DB3E62831303130383135A457BAF4A4BDA769AAA9292E584C53> 機 械 三 甲 01 811001 王 振 祥 國 立 高 雄 應 用 科 技 大 學 模 具 工 程 系 甄 選 入 學 嘉 義 縣 縣 立 水 上 國 中 機 械 三 甲 02 811002 王 紹 誠 弘 光 科 技 大 學 生 物 醫 學 工 程 系 登 記 分 發 嘉 義 縣 縣 立 水 上 國 中 機 械 三 甲 03 811003 江 彥 廷 中 臺 科 技 大 學 牙 體 技 術 暨

More information

nbqw.PDF

nbqw.PDF 2 3 4 5 76,010,200 70,837,163.15 21,694,835.69 6,306,522.69-91,305,083.54 77,237,115.30 0 12,237,082.86 0 0 8,169,816.92 20,406,899.78 0 53,541.43 0 0 0 53,541.43 76,010,200 83,020,704.58 21,694,835.69

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

Microsoft Word - CPFinal2011SpringSolution

Microsoft Word - CPFinal2011SpringSolution 通識計算機程式設計期末考參考解答, 6/24/2011 1. 參考如下的 UML 類別圖, 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 撰寫類別程式 Circle 代表圓形, 其中宣告私有 int 變數 radius 及 double 變數 area, 分別代表半徑及面積 ; 另有預設建構式設定 radius 為 1, 同時設定對應之 area

More information

Java 程式設計初階 第 5 章:基本輸出入 & 流程控制

Java 程式設計初階 第 5 章:基本輸出入 & 流程控制 Java 程式設計 標準輸出入與流程控制 本章大綱 標準輸出入 (Standard I/O) 分支 (Branch) if ~ else switch ~ case 迴圈 (Loop) for while do ~ while 中斷指令 break continue 總整理 標準輸出 定義 : 將資料印到螢幕上 Java 標準輸出指令 System.out.println( 資料 ) 將資料印出後換行

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

More information

02

02 Thinking in C++: Volume One: Introduction to Standard C++, Second Edition & Volume Two: Practical Programming C++ C C++ C++ 3 3 C C class C++ C++ C++ C++ string vector 2.1 interpreter compiler 2.1.1 BASIC

More information

Object-Oriented Programming, Mid-term Test, 11/21/2000

Object-Oriented Programming, Mid-term Test, 11/21/2000 通識計算機程式設計期末考試題參考解答, 6/25/2010 1. 撰寫 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 撰寫類別程式 Rhombus 代表菱形, 其中宣告私有 double 變數 d1 d2, 分別代表兩互相垂直的對角線長, 另有建構式設定 d1 d2 之值, 屬性 D1 D2 分別傳回與設定 d1 d2 之值, 此處可先不處理例外情況

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

ASP.NET MVC Visual Studio MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\M

ASP.NET MVC Visual Studio MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\M ASP.NET MVC Visual Studio 2017 1 1-4 MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\MvcExamples firstmvc MVC 1-7 ASP.NET MVC 1-9 ASP.NET

More information

CWP156.pdf

CWP156.pdf IX-1 IX-2 IX-3 IX-4 IX-5 1 6 11 16 21 26 2000 2001 2002 2003 2004 2005 IX-6 IX-7 8,000 7,000 6,000 5,000 4,000 3,000 2,000 1,000 0 1981 1986 1991 1996 1997 1998 1999 2000 2001 2002 2003 2004 IX-8 85 80-84

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS C H P T E R 7 Windows Vista Windows Vista Windows VistaFT16 FT32NTFS NTFSNew Technology File System NTFS 247 6 7-1 Windows VistaTransactional NTFS TxFTxF Windows Vista MicrosoftTxF CIDatomicity - Consistency

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

Microsoft PowerPoint - EmbSys101_Java Basics.ppt [相容模式]

Microsoft PowerPoint - EmbSys101_Java Basics.ppt [相容模式] Java Basics Hi Hsiao-Lung Chan, Ph.D. Dept Electrical Engineering Chang Gung University, Taiwan chanhl@maili.cgu.edu.twcgu 執行環境 - eclipse 點選 eclipse 軟體執行檔 設定工作路徑 eclipse 開啟 2 建置 Java 專案 File New project

More information

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 JAVA 程 序 设 计 ( 肆 ) 徐 东 / 数 学 系 使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 使 用 Java class 代 表 保 险 箱 public class SaveBox 类 名 类 类 体 实 现 封 装 性 使 用 class SaveBox 代 表 保

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

星星排列 _for loop Protected Sub Page_Load(ByVal sender As Object, ByVal e As Dim h As Integer = 7 'h 為變數 ' Dim i, j As Integer For i = 1 To h

星星排列 _for loop Protected Sub Page_Load(ByVal sender As Object, ByVal e As Dim h As Integer = 7 'h 為變數 ' Dim i, j As Integer For i = 1 To h 資訊系統與實習 製作 : 林郁君 一 2009.09.28 9X9 'button 被按下後 ' Dim i, j As Integer For i = 1 To 9 'i 從 1 到 9' For j = 1 To 9 'j 從 1 到 9' If j * i < 10 Then ' 如果 j 乘上 i 是為個位數 ' Response.Write(i & "*" & j & " =" & i *

More information

《大话设计模式》第一章

《大话设计模式》第一章 第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

Microsoft Word C-A卷.docx

Microsoft Word C-A卷.docx 100 學年度資訊學院程式設計會考 (C) 101/05/5 題組 :A 選擇題及填充題, 請在答案卡上作答, 實作題請填寫於答案卷上, 並於實作題上方填寫班級 姓名 學號 一 選擇題題目 1. unsigned char 的最大值 (a) 127 (b) 255 (c) 512 (d) 1023 2. 下列何者為正確的變數名稱? (a) Android (b) C++ (c) I Phone (d)

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc 第 3 章流程控制和数组 3.1 实验目的 (1) 熟练掌握控制台应用程序的代码编写和调试, 以及运行方法 (2) 掌握选择结构的一般语法格式和应用 (3) 掌握 switch 语句的用法 (4) 掌握选择结构的嵌套的用法, 能灵活使用选择结构解决实际问题 (5) 掌握 while 循环语句的一般语法格式 (6) 掌握 for 循环语句的一般语法格式 (7) 掌握循环嵌套的语法格式 (8) 掌握一维数组的定义

More information

Visual C# 2005程式設計

Visual C# 2005程式設計 Visual Basic 2005 程式設 計 第 5 章流程控制 5-1 認識流程控制 判斷結構 (decision structures) If...Then Else Select Case Try Catch Finally 迴圈結構 (loop structures) For...Next For Each...Next Do...Loop While End While 5-2 If Then

More information

untitled

untitled Visual Basic 2005 (VB.net 2.0) hana@arbor.ee.ntu.edu.tw 立 六 數 串 數數 數 數 串 數 串 數 Len( 串 ) 串 度 Len( 123 )=3 LCase( 串 ) 串 LCase( AnB123 ) anb123 UCase( 串 ) 串 UCase( AnB123 ) ANB123 串 數 InStr([ ], 串 1, 串 2[,

More information

Spyder Anaconda Spyder Python Spyder Python Spyder Spyder Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Sp

Spyder Anaconda Spyder Python Spyder Python Spyder Spyder Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Sp 01 1.6 Spyder Anaconda Spyder Python Spyder Python Spyder Spyder 1.6.1 Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Spyder Python File

More information

新・解きながら学ぶC言語

新・解きながら学ぶC言語 330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180

More information

C/C++程序设计 - 字符串与格式化输入/输出

C/C++程序设计 - 字符串与格式化输入/输出 C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int

More information

Microsoft PowerPoint - 04-array_pointer.ppt

Microsoft PowerPoint - 04-array_pointer.ppt Array 與 Pointer Array Dynamical Memory Allocation Array( 陣列 ) 陣列是用來存放同樣型態的資料陣列的大小必須在程式中預先設定在程式執行中, 陣列的大小無法改變陣列中的資料是透過索引 (index) 來存取 一維陣列的宣告 type array_name[array_size]; int iarray[100]; /* an integer array

More information

Mac Java import com.apple.mrj.*;... public class MyFirstApp extends JFrame implements ActionListener, MRJAboutHandler, MRJQuitHandler {... public MyFirstApp() {... MRJApplicationUtils.registerAboutHandler(this);

More information

51 C 51 isp 10 C PCB C C C C KEIL

51 C 51 isp 10   C   PCB C C C C KEIL http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom

More information

第一章

第一章 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1500 1450 1400 1350 1300 1250 1200 15 16 17 18 19 20 21 22 23 24 25 26 27 28 INPUT2006 29 30 31 32 33 34 35 9000 8500 8000 7500 7000 6500 6000 5500 5000 4500 4000 3500

More information

Scott Effective C++ C++ C++ Roger Orr OR/2 ISO C++ Effective Modern C++ C++ C++ Scoot 42 Bart Vandewoestyne C++ C++ Scott Effective Modern C++ Damien

Scott Effective C++ C++ C++ Roger Orr OR/2 ISO C++ Effective Modern C++ C++ C++ Scoot 42 Bart Vandewoestyne C++ C++ Scott Effective Modern C++ Damien Effective Modern C++ C++ C++ C++11/C++14 C++ Scott Meyers Gerhard Kreuzer Siemens AG Effective Modern C++ Effective Modern C++ Andrei Alexandrescu Facebook Modern C++ Design C++ C++ Nevin Liber DRW Trading

More information

3-1 Wii ( )

3-1 Wii ( ) 03 3-1 3-2 3-3 3-4 3-5 3-1 Wii ( ) 3-2 3-3 8 8 3-4 3-5 3-4 3-3 3-2 3-5 8 ( sin cos ) 3-4 3-5 3-2 CH03_key4.fla ActionScript 3 12 "block_mc" + + "_" + 8 block_mc2_3 x_num y_num 1 01 02 03 04 05 06 07 08

More information

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii 前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time

More information

新版 明解C言語入門編

新版 明解C言語入門編 328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66

More information

0 0 = 1 0 = 0 1 = = 1 1 = 0 0 = 1

0 0 = 1 0 = 0 1 = = 1 1 = 0 0 = 1 0 0 = 1 0 = 0 1 = 0 1 1 = 1 1 = 0 0 = 1 : = {0, 1} : 3 (,, ) = + (,, ) = + + (, ) = + (,,, ) = ( + )( + ) + ( + )( + ) + = + = = + + = + = ( + ) + = + ( + ) () = () ( + ) = + + = ( + )( + ) + = = + 0

More information

新・明解C言語入門編『索引』

新・明解C言語入門編『索引』 !... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 ->

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 -> 目录 1 大概思路... 1 2 创建 WebAPI... 1 3 创建 CrossMainController 并编写... 1 4 Nuget 安装 microsoft.aspnet.webapi.cors... 4 5 跨域设置路由... 4 6 编写 Jquery EasyUI 界面... 5 7 运行效果... 7 8 总结... 7 1 1 大概思路 创建 WebAPI 创建 CrossMainController

More information

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 70-536Chinese(C++) Title : TS:MS.NET Framework 2.0-Application Develop Foundation Version : DEMO 1 / 10 1. Exception A. Data B. Message C.

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

碩命題橫式

碩命題橫式 一 解釋名詞 :(50%) 1. Two s complement of an integer in binary 2. Arithmetic right shift of a signed integer 3. Pipelining in instruction execution 4. Highest and lowest layers in the TCP/IP protocol suite

More information

第1章

第1章 第 15 章 標準類別 1 本章提要 15.1 前言 15.2 基本資料類別介紹 15.3 Integer 類別 15.4 Double 類別 15.5 Float 類別 Long 類別 Short 類別 15.6 數學相關類別 Math 15.7 後記 2 15.1 前言 不同基本資料型別可以互相轉換, 但也只予許由小轉大的情況, 例如 1. byte 轉為 short int long float

More information

数据结构与算法 - Python基础

数据结构与算法 - Python基础 Python 教材及课件 课件及作业见网址 xpzhang.me 1 1. Python 2. 3. (list) (tuple) 4. (dict) (set) 5. 6. 7. 2 Python Python 3 Python 4 Python 1, 100, -8080, 0,... 0x 0-9, a-f 0 xff00, 0 xa432bf 5 1.24, 3.14, -9.80,...

More information

The golden pins of the PCI card can be oxidized after months or years

The golden pins of the PCI card can be oxidized after months or years Q. 如何在 LabWindows/CVI 編譯 DAQ Card 程式? A: 請參考至下列步驟 : 步驟 1: 安裝驅動程式 1. 安裝 UniDAQ 驅動程式 UniDAQ 驅動程式下載位置 : CD:\NAPDOS\PCI\UniDAQ\DLL\Driver\ ftp://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/unidaq/dll/driver/

More information

Microsoft Word - CPE考生使用手冊160524.docx

Microsoft Word - CPE考生使用手冊160524.docx 大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該

More information

Microsoft PowerPoint - L17_Inheritance_v4.pptx

Microsoft PowerPoint - L17_Inheritance_v4.pptx C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance

More information

Microsoft PowerPoint - Chap03.ppt [相容模式]

Microsoft PowerPoint - Chap03.ppt [相容模式] 本章目的 2D / 3D 遊戲程式設計入門使用 XNA 3.0 與 C# 探討 XNA 遊戲程式內部的基本架構與遊戲開發流程 示範如何完成一個簡單的 XNA 遊戲方案 第三章 XNA 遊戲程式基本架構 1 2 新增 XNA 專案 新增 XNA 專案 3 4 XNA 相關的命名空間 Game1.cs 程式中的六個函數 using Microsoft.Xna.Framework; // 和 XNA 架構相關的型別

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information