Microsoft Word - CPMidTerm2010SpringSolution

Size: px
Start display at page:

Download "Microsoft Word - CPMidTerm2010SpringSolution"

Transcription

1 通識計算機程式設計期中考參考解答, 4/23/ (a) 宣告 double 變數 z, bool 變數 b, int 變數 i (3%) 答 : double z; bool b; (b) 在螢幕顯示一行字, 要求使用者輸入一個浮點數. (3%) 答 : Console.WriteLine(" 輸入一個浮點數 "); (c) 自鍵盤讀入一個浮點數., 並將其值存入已宣告之 double 變數 z (3%) 答 : z = double.parse(console.readline()); (d) 令已宣告之 bool 變數 b 等於邏輯敘述 z > 0 的結果. (3%) 答 : b = z > 0; (e) 若.b 為真, 在螢幕顯示 z > 0 否則印出 z <= 0 (3%) 答 : if (b) Console.WriteLine("z > 0"); else Console.WriteLine("z <= 0"); 或 string message = b? "z > 0" : "z <= 0"; Console.WriteLine(message); 2. (a) 將已宣告設值之 int 變數 n 先設定 (assign) 給他處已宣告之 int 變數 m 後, 再使用遞增算子 ++ 加 1 (3%) 答 : m = n++; 或 m = n; ++n; 1/14

2 (b) 令他處已宣告之 int 變數 q 等於他處已宣告設值之 int 變數 p 除以 9 的商 (3%) 答 : q = p / 9; (c) 宣告 double 變數 db, 並令其值為 double 變數 x 之以 10 為底的對數值乘以 20.0 (3%) 答 : double db = 20.0 Math.Log10(x); (d) 宣告 string 變數 s, 利用三元運算子使其在他處已宣告設值之 double 變數 speed 大於等於 時等於 超速, 反之則等於 正常速率 (3%) 答 : string s = (speed >= 110.0)? " 超速 " : " 正常速率 "; (e) 宣告變數 r 為 char 型別, 並令其值為結束本行, 另起一行之 new line 字元 (3%) 答 : char r = '\n'; 3. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告一個其值為 5 的 int 常數 ARRAY_SIZE (3%) 答 : const int ARRAY_SIZE = 5; (b) 宣告一個長度為 int 常數 ARRAY_SIZE 的 int 陣列, 命名為 a (3%) 答 : int[] a = new int[array_size]; (c) 寫一個 for 迴圈, 將陣列 a 的每個元素都設值為 0 (3%) 答 : for (i = 0; i < ARRAY_SIZE; ++i) a[i] = 0; (d) 將順序為第 3 的 a 陣列元素之值設為 9 (3%) 答 : a[2] = 9; (e) 將陣列 a 的所有元素之值印在同一行, 各元素值之間以水平定位符號 (tab) 分隔 ; 印完後螢幕畫面要結束本行, 另起一行 寫出螢幕輸出 (3%) 2/14

3 答 : for (i = 0; i < ARRAY_SIZE; ++i) Console.Write(a[i] + "\t"); Console.WriteLine(); 螢目輸出為 : 4.. (a) (3%) float d = 10.5; 答 :10.5 為 double 常數, 設為 float 變數時會損失精確度 更正 : double d = 10.5; 或 float d = 10.5f; 或 float d = (float) 10.5; (b) (3%) enum Color RED = 1, YELLOW = 2, GREEN = 3... Color color; Console.Write(" 輸入 1~3 的整數, 分別代表紅 黃 綠 "); int c = Convert.ToInt16(Console.ReadLine()); switch (c) case 1: color = RED; break; 3/14

4 case 2: color = YELLOW; break; case 3: color = GREEN; break; default: color = RED; break; 答 : 列舉型別之值使用時必須加上型別名稱更正 : Color color; Console.Write(" 輸入 1~3 的整數, 分別代表紅 黃 綠 "); int c = Convert.ToInt16(Console.ReadLine()); switch (c) case 1: color = Color.RED; break; case 2: color = Color.YELLOW; break; case 3: color = Color.GREEN; break; default: color = Color.RED; break; (c) (3%) 以下程式片段應計算 2 到 10 的偶數和. int sum = 0; for ( i=2; i < 10; i=i+2 ) sum += i; 答 : 此為 off by one error, 沒有把 10 加入 sum 之中更正 : int sum = 0; for (i = 2; i <= 10; i = i + 2) sum += i; (d) (3%) 以下程式片段應印出 計程很操! 字樣 3 次. int n = 1; do Console.WriteLine( 計程很操! ); 4/14

5 while ( n <= 3 ); 答 : 迴圈中控制變數 n 沒有改變, 始終都是 1, 所以形成無窮迴圈, 不斷印出 計程很操! 字樣更正 : int n = 1; do Console.WriteLine(" 計程很操!"); ++n; while ( n <= 3 ); 或 (e) (3%) 下列程式片段呼叫函式 Triple 設定變數 b 的數值. class Program static void Main(string[] args) int a = 3; int b = Triple(a); static int Triple(int x) int y = 3x; 答 : 函式 Triple 傳回一個整數, 須以 return 傳送結果給呼叫程式. 更正 : class Program static void Main(string[] args) int a = 3; int b = Triple(a); static int Triple(int x) int y = 3x; 5/14

6 return y; 5. 試寫出下列程式的輸出 (5%) using System; namespace MidTerm2010Problem5 class Program static void Main(string[] args) int[] a = 4, 5, 6 ; int[] b = a; WhatDoesThisDo(ref a); Console.WriteLine("a[2] = 0, b[2] = 1", a[2], b[2]); static void WhatDoesThisDo(ref int[] x) x[2] = 7; x = new int[4] 8, 9, 0, 1 ; 答 : 6. 試寫出下列程式的輸出 (5%) using System; namespace MidTerm2010Problem6 class Program 6/14

7 static void Main(string[] args) int[,] x = 2, 3, 2, 1, 1, 2, 1, 3, 2, 1, 1, 1, 2, 1, 3, 3, 2, 1, 1, 2, 1, 2, 3, 2, 1 ; int n = x.getupperbound(0) + 1; int[,] y = new int[n, n]; for (i = 0; i < n; ++i) y[i, 0] = 0; y[i, n-1] = 0; y[0, i] = 0; y[n-1, i] = 0; int j; for (i = 1; i < n - 1; ++i) for (j = 1; j < n - 1; ++j) y[i, j] = Laplacian(x, i, j); for (i = 0; i < n; ++i) for (j = 0; j < n; ++j) Console.Write(y[i, j] + "\t"); Console.WriteLine(); static int Laplacian(int[,] x, int i, int j) int y = x[i - 1, j] + x[i + 1, j] + x[i, j - 1] + 7/14

8 答 : return y; x[i, j + 1] - 4 x[i, j]; 7. 簡單說明 TDD 的過程 (5%) 答 : (1). 撰寫一個簡單的測試主程式, 呼叫一個待測試的函式 (2). 進行建置, 看它失敗 (3). 增添恰能通過測試的函式程式碼, 並建置 執行 偵錯 (4). 重構 ( 例如使用較有意義的變數名稱 ) 及消除冗餘程式碼 ( 例如將重複 且有獨立價值的程式碼改寫為函式 ), 並建置 執行 除錯 (5). 反覆進行以上步驟 8. / MidTerm2010Problem8 Magic Square skj 4/22/2010 測試規劃 1. / \ 是幻方 8/14

9 4 9 2 \ / 2. / \ 是幻方 \ / 3. / \ 不是幻方 \ / 檢驗幻方虛擬碼 函式 IsMagicSquare( 二維陣列 a) 假設方陣以二維陣列 a 表示, 其元素值為 1 到 n 平方的整數 且每個整數均恰好出現一次 ( 不檢查 ) 令數 mm = n(nn+1)/2 為幻方 每行之和, 每列之和, 及兩對角線之和 應有之值 1. 驗證每列之和均等於 M 2. 驗證每行之和均等於 M 3. 驗證主對角線之和等於 M 4. 驗證次對角線之和等於 M 檢查每列之和虛擬碼 函式 RowSumOK( 二維陣列 a, M) 設 a 為 n 乘 n 方陣 1. for(i=0; i<n; ++i) sum = 0 for(j=0; j<n; ++j) 9/14

10 sum += a[i,j] if( sum 不等於 M ) return false 2. return sum 檢查每行之和虛擬碼 函式 ColumnSumOK( 二維陣列 a, M) 設 a 為 n 乘 n 方陣 1. for(j=0; j<n; ++j) sum = 0 for(i=0; i<n; ++i) sum += a[i,j] if( sum 不等於 M ) return false 2. return sum 檢查主對角線之和虛擬碼 函式 MainDiagnalOK( 二維陣列 a, M) 設 a 為 n 乘 n 方陣 1. sum = 0 2. for(i=0; i<n; ++i) sum += a[i,i] 3. if( sum 等於 M ) return true else return false 檢查次對角線之和虛擬碼 函式 SubDiagnalOK( 二維陣列 a, M) 設 a 為 n 乘 n 方陣 1. sum = 0 2. for(i=0; i<n; ++i) 10/14

11 sum += a[i,n-1-i] 3. if( sum 等於 M ) return true else return false / using System; using System.Diagnostics; namespace MidTerm2010Problem8 class Program static void Main(string[] args) // 測試 Debug.Assert(Test_1_OK()); Debug.Assert(Test_2_OK()); Debug.Assert(Test_3_OK()); // 主程式 int[,] a = InputArray(); string message = IsMagicSquare(a)? " 此方陣為一幻方 " : " 此方陣非幻方 "; Console.WriteLine(message); static bool Test_1_OK() int[,] a = 8, 1, 6, 3, 5, 7, 4, 9, 2 ; return IsMagicSquare(a); static bool Test_2_OK() 11/14

12 int[,] a = 1, 15, 14, 4, 12, 6, 7, 9, 8, 10, 11, 5, 13, 3, 2, 16 ; return IsMagicSquare(a); static bool Test_3_OK() int[,] a = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ; return!ismagicsquare(a); static bool IsMagicSquare(int[,] a) int n = a.getupperbound(0) + 1; int mm = n (n n + 1) / 2; if (!RowSumOK(a, n, mm)) return false; if (!ColumnSumOK(a, n, mm)) return false; if (!MainDiagonalOK(a, n, mm)) return false; if (!SubDiagonalOK(a, n, mm)) return false; return true; static bool RowSumOK(int[,] a, int n, int mm) int j; int sum; for (i = 0; i < n; ++i) sum = 0; for (j = 0; j < n; ++j) sum += a[i, j]; if (sum!= mm) return false; 12/14

13 return true; static bool ColumnSumOK(int[,] a, int n, int mm) int j; int sum; for (j = 0; j < n; ++j) sum = 0; for (i = 0; i < n; ++i) sum += a[i, j]; if (sum!= mm) return false; return true; static bool MainDiagonalOK(int[,] a, int n, int mm) int sum = 0; for(i=0; i<n; ++i) sum += a[i, i]; return (sum == mm); static bool SubDiagonalOK(int[,] a, int n, int mm) int sum = 0; for(i=0; i<n; ++i) sum += a[i, n i]; return (sum == mm); 13/14

14 static int[,] InputArray() Console.Write(" 輸入方陣階數 : "); int n = int.parse(console.readline()); Console.WriteLine( " 輸入方陣元素, 必須在 1 和 0 之間 ", n n); Console.WriteLine(" 不能重複 "); int j; string[] item = new string[n]; int[,] a = new int[n, n]; for (i = 0; i < n; ++i) Console.WriteLine( " 輸入第 0 列之 1 個元素, 以逗點分隔 ", i+1, n); item = (Console.ReadLine()).Split(','); for (j = 0; j < n; ++j) a[i, j] = int.parse(item[j]); // Echo Console.WriteLine(" 輸入之方陣為 :"); for (i = 0; i < n; ++i) for (j = 0; j < n; ++j) Console.Write(a[i, j] + "\t"); Console.WriteLine(); return a; 14/14

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

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

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 - CPMidTerm2012SpringSolution

Microsoft Word - CPMidTerm2012SpringSolution 通識計算機程式設計期中考參考解答, 4/20/2012 1. 撰寫一或數個 C# 敘述達成下列要求 : ( 假設 using System; 敘述已經包含於程式中 ) (a) 宣告 int 變數 k, bool 變數 b, double 變數 x (3%) int k; bool b; double x; (b) 在螢幕顯示一行字, 要求使用者輸入一個浮點數 (3%) Console.WriteLine("

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 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 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

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 類别 欄 (1) 類 類 狀 更 易 類 理 若 類 利 來 利 using 來 namespace 類 ; (2) namespace IBM class Notebook namespace Compaq class Notebook 類别 類 來 類 列 欄 (field) (property) (method) (event) 類 例 立 來 車 類 類 立 車 欄 料

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

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

FY.DOC

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

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

新版 明解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

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

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

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

第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

Microsoft Word - 01.DOC

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

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

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

碩命題橫式

碩命題橫式 一 解釋名詞 :(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

第一章 章标题-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

新版 明解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

新・明解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

<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

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

<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

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

untitled

untitled 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-1-1 C int main(void){ int x,y,z; int sum=0; double avg=0.0; scanf("%d",&x) ; scanf("%d",&y) ; scanf("%d",&z) ; sum=x+y+z ; avg=sum/3.0; printf("%f\n",avg); system("pause");

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

第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

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

概述

概述 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

Microsoft PowerPoint - ds-1.ppt [兼容模式]

Microsoft PowerPoint - ds-1.ppt [兼容模式] http://jwc..edu.cn/jxgl/ HomePage/Default.asp 2 说 明 总 学 时 : 72( 学 时 )= 56( 课 时 )+ 16( 实 验 ) 行 课 时 间 : 第 1 ~14 周 周 学 时 : 平 均 每 周 4 学 时 上 机 安 排 待 定 考 试 时 间 : 课 程 束 第 8 11 12 章 的 内 容 为 自 学 内 容 ; 目 录 中 标 有

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 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

Microsoft Word - ACL chapter00a-1ed .doc

Microsoft Word - ACL chapter00a-1ed .doc 序三 A* Wi-Fi RLE RSA - v - 前言 NPC Horner s rule DOS PCX RLE RSA - - vii - 演算法的樂趣 0-1 60 23 1 32 O(n) O(n 2 ) O(n) O(n) MP3 - viii - 前言 http://books.gotop.com.tw/download/acl045600 http://blog.csdn.net/orbit/

More information

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

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

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

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

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

《大话设计模式》第一章

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

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

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

全國各級農會第 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

Microsoft PowerPoint - C_Structure.ppt

Microsoft PowerPoint - C_Structure.ppt 結構與其他資料型態 Janet Huang 5-1 結構的宣告 struct 結構名稱 struct 結構名稱變數 1, 變數 2,, 變數 m; struct 結構名稱 變數 1, 變數 2,, 變數 m; student; student; 5-2 1 結構變數初值的設定 struct 結構名稱 struct 結構名稱變數 = 初值 1, 初值 2,, 初值 n student="janet","1350901",100,95

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

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

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

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

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

Microsoft PowerPoint - 20-string-s.pptx

Microsoft PowerPoint - 20-string-s.pptx String 1 String/ 1.: char s1[10]; char *s2; char s3[] = "Chan Tai Man"; char s4[20] = "Chan Siu Ming"; char s5[]={'h','e','l','l','o','\0'; 0 1 2 3 4 5 6 7 8 9 10 11 12 s3 C h a n T a i \0 M a n \0 printf

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

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

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 PowerPoint - ch1.pptx

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

More information

C/C++语言 - 分支结构

C/C++语言 - 分支结构 C/C++ Table of contents 1. if 2. if else 3. 4. 5. 6. continue break 7. switch 1 if if i // colddays.c: # include int main ( void ) { const int FREEZING = 0; float temperature ; int cold_ days

More information

nooog

nooog C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1

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

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

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

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

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

内 容 提 要 指 针 持 久 动 态 内 存 分 配 字 符 串 ( 字 符 数 组 ) 2

内 容 提 要 指 针 持 久 动 态 内 存 分 配 字 符 串 ( 字 符 数 组 ) 2 第 六 讲 指 针 与 字 符 串 1 内 容 提 要 指 针 持 久 动 态 内 存 分 配 字 符 串 ( 字 符 数 组 ) 2 指 针 什 么 是 指 针 指 针 的 定 义 与 运 算 指 针 与 一 维 数 组 指 针 数 组 行 指 针 与 二 维 数 组 指 针 与 引 用 指 针 与 函 数 3 指 针 定 义 什 么 是 指 针 指 针 变 量, 简 称 指 针, 用 来 存 放

More information

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit 6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128

More information

Microsoft PowerPoint - C-Ch11.ppt

Microsoft PowerPoint - C-Ch11.ppt 各式各樣的資料型態 11-1 結構的基礎知識 決定新的型態 關於結構 結構資料型態可以將不同資料型態的值整合成新的型態 結構型態的宣告語法 : struct 結構型態 { 資料型態識別字 ; 資料型態識別字 ; }; 加上 struct 進行宣告 宣告結構變數 語法 : 結構型態結構變數名稱 ; 範例 : struct Car car1; 對成員進行存取 使用結構型態的成員時, 必須使用成員選擇運算子

More information

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

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information

Microsoft PowerPoint - 06_迴圈2.pptx

Microsoft PowerPoint - 06_迴圈2.pptx 資料型別的選擇 如果資料或是運算過程可能會出現小數點 (e.g. BMI), 宜使用浮點數 (double, float) char 僅能儲存一個英文字 數字 或是英文中出現的標點符號等等鍵盤上可直接看得到 按得出的符號 若要儲存中文字, 目前建議使用 string 型別 A 和 A 的差別, 我們目前還沒辦法說得很詳細 只能說一個是字元 一個是字串 布林運算式的寫法 如果 x 等於, 就印出 Hello

More information

_汪_文前新ok[3.1].doc

_汪_文前新ok[3.1].doc 普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向

More information

chp6.ppt

chp6.ppt Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行

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

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

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

中国帝王私生活未解之谜(三).doc

中国帝王私生活未解之谜(三).doc () ...1...7...13...23...31...35...40...45...50...58...65...71...80...90...98... 108... 116... 126... 130 I ... 137... 144... 149... 156... 161... 167... 177... 186... 192 II 1 (540 604 ) 581 604 ( ) (

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

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

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

chap07.key

chap07.key #include void two(); void three(); int main() printf("i'm in main.\n"); two(); return 0; void two() printf("i'm in two.\n"); three(); void three() printf("i'm in three.\n"); void, int 标识符逗号分隔,

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

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检 2016 年 上 半 年 软 件 设 计 师 考 试 真 题 ( 下 午 题 ) 下 午 试 题 试 题 一 ( 共 15 分 ) 阅 读 下 列 说 明 和 图, 回 答 问 题 1 至 问 题 4, 将 解 答 填 入 答 题 纸 的 对 应 栏 内 说 明 某 会 议 中 心 提 供 举 办 会 议 的 场 地 设 施 和 各 种 设 备, 供 公 司 与 各 类 组 织 机 构 租 用 场

More information

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

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

More information

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

More information

javaexample-02.pdf

javaexample-02.pdf n e w. s t a t i c s t a t i c 3 1 3 2 p u b l i c p r i v a t e p r o t e c t e d j a v a. l a n g. O b j e c t O b j e c t Rect R e c t x 1 y 1 x 2 y 2 R e c t t o S t r i n g ( ) j a v a. l a n g. O

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

概述

概述 OPC Version 1.8 build 0925 KOCRDK Knight OPC Client Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOC_Init...5 2.2.2 KOC_Uninit...5 2.3...5

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

Microsoft Word - PHP7Ch01.docx

Microsoft Word - PHP7Ch01.docx PHP 01 1-6 PHP PHP HTML HTML PHP CSSJavaScript PHP PHP 1-6-1 PHP HTML PHP HTML 1. Notepad++ \ch01\hello.php 01: 02: 03: 04: 05: PHP 06:

More information

書本介紹

書本介紹 班 級 經 營 期 末 報 告 組 員 : 幼 三 甲 4A0I0030 蔡 依 璇 4A0I0048 蘇 家 儀 4A0I0096 張 容 嫣 4A0I0098 袁 少 潔 書 本 介 紹 閱 讀 對 象 : 小 學 低 年 級 的 老 師 新 生 家 長 有 意 從 事 小 學 者 及 關 心 教 育 品 質 的 社 會 人 士 內 容 : 1. 教 師 如 何 成 功 有 效 地 經 營 低

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

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

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

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj Message Transition 5-1 5-2 DataInputStream Class 5-3 DataOutputStream Class 5-4 PrintStream Class 5-5 (Message Transition) (Exercises) Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream

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

数据结构与算法 - 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

Microsoft PowerPoint - ch04_AEL0080.ppt

Microsoft PowerPoint - ch04_AEL0080.ppt 4 選擇 在正常的情況下, 電腦程式的執行是以敘述的排列次序逐步處理的 使用控制架構 (control structures) 可以改變這種既定的先後次序, 讓程式得以進行更複雜的運算, 或以更簡潔的指令來實現演算法 1/42 選擇 4.1 演算法的描述方式 4.2 變數的運用範圍 (Scope of variables) 4.3 if- 敘述 4.4 巢狀 if- 敘述 (Nested if statements)

More information

Strings

Strings Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A

More information

1

1 守大學電機系 電腦視覺 報告 單元一 數位影像 : 格式和操作 參考解答 MIAT( 機器智慧與自動化技術 ) 實驗室 中華民國 93 年 9 月 29 日 1. (a) 如果指紋影像 finger300x300 的取像面積是 14(mm)x14(mm), 請計算取像系統的 dpi (b) 如果 kaoshiung512x512 遙測影像的覆蓋面積是 5(Km)x5(Km), 請計算該影像的解析度

More information