Microsoft Word - Prog doc

Size: px
Start display at page:

Download "Microsoft Word - Prog doc"

Transcription

1 2. C/C++ 程式設計 2.1 編寫 C/C++ 的程式 (1). 主要程式架構 範例程式 #include<stdio.h> main( ) { int i; i = 12; printf( It is %d \n,i); } main( ) 為主程式的進入點 ( 程式最先會先進入本 Function) 每一行的最後皆要加 ;" printf(..) 以指定的格式印出文字 標頭檔 c:\progra~1\visua~1\vc98\include\stdio.h... _CRTIMP int cdecl printf(const char *,...);... 在 C 的主程式中並沒有函數的定義, 所有的函數皆須經過定義, 為了便於維護, 故將其寫於.h 的檔案中 宣告的部分, 最後要加 ;" 註解 // : 單行的註解 /* */ : 整個區塊的註解 (2). 產生執行檔 程式編譯的流程 *.h 其他程式的 *.cpp compilier *.obj *.lib *.obj Linker *.exe 程式編譯的相關檔案 Preprocessor 處理 *.h Compiler 處理 *.cpp 並產生 *.obj 8

2 Link 連結相關的 *.Lib, *.obj 產生 *.exe 變數的宣告 int i,j,k;... i = 4; j = 12; int ind;... 前面為所要宣告的變數型態, 可能為 int, float, char,... 接著才是變數名稱 同一個區域 (block) 內的變數名稱不可重複 (3). 範例練習 範例 2.1-1: C++ 的程式進入點為 (1) Main() (2) main (3) class (4) start Ans: (2) 範例 2.1-2: 在 C/C++ 的程式中, 下列何者用來作為輸出? (1) printf() (2) scanf() (3) int (4) #include Ans: (1) 範例 2.1-3: 在 C/C++ 中, 每一行的最後皆要加上何種符號作為行與行的區隔? (1) : (2), (3) {} (4) ; Ans: (4) 範例 2.1-4: 下面的程式中, 程式的註解放在第 _4_ 行 1 main( ) 2 { 3 int i; 4 i = 12; // Initialize the i 5 printf( It is %d \n,i); 6 } 範例 2.1-4: 如果要印出 Hello World!, 則用 C 的程式要如何寫? Ans: printf( Hollo World! ); 2.2 變數的基本觀念 (1). 變數型態 Integer 可分成下面不同長度的資料型態 ( 與範圍 ) int bytes (16bit) ~ short int bytes 9

3 long int bytes unsigned int bytes 0 ~ float (4 bytes, Single-Precision Floating point) double (8 bytes, Double-Precision Floating point) char (1 bytes) 表示 0 ~ 255 的符號 特殊字元 \n new line \b back space \t Tab \f feed (page) \ 雙引號 \\ 倒斜線 \xdd 16h \ddd decimal \r return \ 單引號 \0 空格 const ( 常數 ) 可用來宣告常數的變數, 如 : const int myvar = 15; 在程式編譯中會將其轉為數字, 如 : 10 進位 : 進位 : ox13 8 進位 : o13 long : 13L float: 13.4 char : `A', `1', `a', char[?]: ( 字串 ) ABC", A123", (? 表示所要儲存的字元數 ) (2). 運算元 遞增 : i++ (i--) 執行該行敘述後, 再加上 1 ++i (--i) 先加上 1, 再執行該行敘述 下面的程式會印出 3 int i = 3; printf( %d, i++); 下面的程式會印出 4 int i = 3; printf( %d, ++i); 比較 : >, <, >=, <=, ==,!= 下面的程式會印出 1 (true) int a = 3, b = 4; printf( %d, (a<b)); 下面的程式會印出 0 (false) int a = 3, b = 4; printf( %d, (a==b)); 邏輯 : && (and), (or),! (not) 下面的程式會印出 1 (true) 10

4 int a = 3, b = 4, c = 5; printf( %d, ((a<b) && (a<c))); 下面的程式會印出 0 (false) int a = 3, b = 4, c = 5; printf( %d, ((a>b) && (a>c))); 算數 : * (mul), / (div), % (mod) 下面的程式會印出 0 (false) int a = 3, b = 4; printf( %d, (!(a<b)); 下面的程式會印出 1 (true) int a = 3, b = 4; printf( %d, ((a*3)>(b+3))); (3). 型別轉換 自動轉換 依照運算結果來轉型 : int a = 1; float b =1.2; float c = a+b; // c= 強制轉換 指定所要轉換的型別 c = (int)a + (int)b; // c = 2 (4). 範例練習 範例 : ( 變數宣告 ) 要宣告一個整數的變數 myvar, 則要用下面哪一個敘述? (1) float myvar; (2) char myvar; (3) int myvar; (4) double myvar; Ans: (3) 範例 : ( 變數宣告 ) 要宣告一個小數的變數 myvar, 則要用下面哪一個敘述? (1) float var; (2) char myvar; (3) int myvar; (4) long myvar; Ans: (1) 範例 : ( 變數宣告 ) 要宣告一個字元的變數 myvar, 則要用下面哪一個敘述? (1) float var; (2) char myvar; (3) int myvar; (4) double myvar; Ans: (2) 範例 : ( 變數宣告 ) 請指出下面程式的錯誤 ( 寫出行數與正確寫法 ) 1 int myvar = 12; 2 int y2b = 13; 3 myvar = y2b+5; 4 int myvar = 10; 5 printf( %d %f, y2b, myvar); Ans: 第 4 行錯誤 ( 重複宣告 ), 正確寫法分別為為 myvar = 10; 範例 : ( 運算元 ) 11

5 請寫一個程式印出兩個 int 相加 Ans: int i = 3; int j = 5; printf( %d + %d = %d,i, j, i+j) 範例 : ( 運算元 ) 請指出下面程式的錯誤 ( 寫出行數與正確寫法 ) 1 int a; 2 int b; 3 int a = 63; 4 int b = 72.5; 5 printf( %f, a+b); Ans: 第 3, 4 行錯誤 ( 重複宣告 ), 正確寫法分別為為 a = 63; 與 b = 72.5; 範例 : ( 運算元 ) 要寫一個程式來計算兩人體重的和, 請指出下面程式的錯誤 ( 寫出行數與正確寫法 ) 1 int a; 2 int b; 3 a = 63; 4 b = 72.5; 5 printf( %f, a+b); Ans: 第 1, 2 行錯誤, 正確寫法分別為為 float a; 與 float b; 範例 : ( 運算元 ) 要寫個程式計算兩間教室的人數和, 請指出下面程式的錯誤 ( 寫出行數與正確寫法 ) 1 int a; 2 float b; 3 a = 23; 4 b = 42; 5 printf( %d, a+b); Ans: 第 2 行錯誤, 正確寫法分別為為 int b; 範例 : ( 運算元 ) 1 int a = 2; 2 int b = 4; 3 a++; 4 b--; 5 a = a + b; 5 printf( %d - %d, a, b); Ans: 6-3 範例 : ( 運算元 & 註解 ) 1 int a = 2; 2 int b = 4; 3 // a++; 4 b = b + a; 5 /* 6 b++; 7 */ 12

6 8 printf( %d - %d, a, b); Ans: 2-6 範例 : ( 運算元 ) 1 int a = 2, b = 4; 2 printf( %d - %d, a++, ++b); Ans: 2-5 範例 : ( 邏輯比較 ) 1 int a = 2, b = 4; 2 printf( %d, (a>b)); Ans: 0 範例 : ( 邏輯比較 ) 1 int a = 2, b = 4; 2 printf( %d, (!(a>b))); Ans: 1 範例 : ( 邏輯比較 ) 1 int a = 2, b = 4, c = 6; 2 printf( %d, ((a*3)>=(b*2))); Ans: 0 範例 : ( 邏輯比較 ) 1 int a = 2, b = 4, c = 6; 2 printf( %d, ((a<3) && (c>4))); Ans: 1 範例 : ( 邏輯比較 ) 1 int a = 2, b = 4, c = 6; 2 printf( %d, ((a<2) (b>4))); Ans: 0 範例 : ( 邏輯比較 ) 1 int a = 2, b = 4, c = 6; 2 printf( %d, ((a+b)<3 (b+c)>10)); Ans: 0 範例 : 1 int i = 2,j = 3, k = 4; 2 k++; 3 i++; 4 j--; 5 k = i+j; 6 printf( %d - %d - %d, i, j, k); 13

7 Ans: 範例 : ( 型別轉換 ) int a = 1; float b =1.2; float c = a+b; printf( %3.2f, c); Ans: 2.20 範例 : ( 型別轉換 ) int a = 1; float b =1.2; float c = (int)a+(int)b; 2 printf( %3.2f, c); Ans: 2.00 範例 : ( 常數 ) 下面為計算圓面積的程式, 請指出下面程式的錯誤與正確寫法 1 const float pi; // 元周率 2 int j; // 半徑 3 pi = 3.14; 4 j = 2; 5 printf( 面積為 : %3.2f, j*j*pi); Ans: 第 1, 3 行錯誤, 正確寫法為去掉第 3 行, 第 1 行改為 const float pi = 3.14; 2.3 基本輸入輸出 (1). printf( formatting string, var1, var2,..); 格式化字串 : formatting string 為所要格式化的 string 型式 該型式依不同的變數型態而有不同的表示, 如 : % [-][+][long][.fixed][f/e] - : 向左靠齊 +: 正數印出正號 %d Decimal %u Unsign Integer %f Float (fixed) i.e. %-12.2f %e Float (Exp) %c Char 所要印出的變數 : var1.. varn 所要印出的變數 也可以為常數 變數不數目需要和格式數目相同 ( 如 %d 的個數 ) 14

8 (2). scanf(formatting string, &var1, &var2, ); 作為輸入資料之用 formatting string 的設定方式和 printf 相同, 只是資料的傳輸方向不同 int, float 的輸入 int a,b; scanf("%d %d",&a,&b); printf("%s %d \n","a+b",a+b); 由於資料輸入需要對應到 Memory Address, 故需加上 & 的符號 使用者在輸入多個資料時, 以 空白 隔開不同的資料, 並在資料輸入完成後按下 [Enter] 鍵 [Enter] 接下來在程式取用該變數時, 只需要直接使用變數名即可, 不需加 & 的符號 float 的輸入方式相同, 只是使用 %f 而已 " char 的輸入 char a,b; scanf("%c %c",&a,&b); printf("%s %c %c \n","result=",a,b); 字元的輸入方式相同 若在 %" 的後面加上 *" 則表示要略過該資料項 scanf("%c %*c %c",&a,&b); 只會讀取第一個及第三個 string 的輸入 char a[20],b[20]; scanf("%c %c",&a,&b); printf("%s \n",a); printf("%s \n",b); 字元的輸入方式相同, 仍然以空白作為 string 的分隔 a[20] 代表宣告一個長度為 20 的 String (3). getche() & getchar() 主要功能 兩者皆是用來讀取使用者所按下的 Key getwchar() 不需按 [Enter] (without echo) getchar() 需要按 [Enter] (with echo).. 使用方式 如下面的範例 char c1, c2; c1 = getche(); // No [Enter] needed c2 = getchar(); // Need [Enter] printf(" %c -- %c \n",c1,c2); 15

9 Visual C++ char c1, c2; c1 = _getch(); // Without Echo c2 = _getche(); // With Echo putchar(c1); putchar(c2); 此函數需要 #include <conio.h> User Input 12" 結果為 212 (4). putchar(`a') 輸出一個字元 使用方式 char c1; c1 = getche(); putchar(c1); // No [Enter] needed (5). 範例練習 範例 : (printf 格式化 ) 有兩個變數 int i = 35; 與 int j = 123; 要將它們印出如下結果, 則程式要如何寫? *** *** Ans: printf("***\n"); printf("%3d\n", i); printf("%3d\n", j); printf("***\n"); 範例 : (scanf) 有變數 int i = 35; 要在程式中改為 42, 請指出下面程式錯誤處 ( 寫出行數與正確寫法 ) 1 int i = 35; 2 i++; 3 i = 42; 4 scanf( %d, i); Ans: 第 4 行, 正確為 scanf( %d, &i); 範例 : (char) 要在程式中輸入整數 12 與字元 a, 請指出下面程式錯誤處 ( 寫出行數與正確寫法 ) 1 int a = 45; 2 char b = a ; 3 printf( a=%d, b=%c\n, a, b); 4 scanf( %d %d, &a, &b); Ans: 第 4 行, 正確為 scanf( %d %c, &a, &b); 範例 : (char) 要在程式中輸入整數 12 與字串 mary, 請指出下面程式錯誤處 ( 寫出行數與正確寫法 ) 1 int a = 45; 16

10 2 char b = ; 3 printf( a=%d, b=%s\n, a, b); 4 scanf( %d %s, &a, &b); Ans: 第 2 行, 正確為 char b[5] = ; 請指出下面程式錯誤處 ( 寫出行數與正確寫法 ) 1 int a = 45, c = 68; 2 char b[4] = good ; 3 a++; 4 printf( the number a is %d\n, a); 5 ++a; 6 printf( the results b is %s\n, b); Ans: 第 2 行, 正確為 char b[5] = good ; 1 int a = 45, b = 20; 2 char name[10] = after10 ; 3 a = a + b; 4 printf( %d - %c\n, a, name[1]); Ans: 65 - f printf("%d", ( a > Z ); Ans: 1 printf("%d", ( z > D ); Ans: 1 1 char a = 'b'; 2 char name[10] = "after10"; 3 printf("%d", (a>name[1])); Ans: 0 1 char a = 'b'; 2 char name[10] = "after10"; 3 printf("%d", (a>name[0])); Ans: 1 1 char name[20] = "It is my dog"; 2 printf("%c%c", name[1], name[3]); Ans: ti 17

11 1 char name[20] = "abcdef"; 2 printf("%c%c", name[3], name[0]); Ans: da 1 char name[20] = "boy and mary"; 2 printf("%c%c", name[3], name[6]); Ans: d 要在程式中輸入姓名 (name) 與年齡 (age), 請指出下面程式錯誤處 ( 行數與正確寫法 ) 1 int age; 2 char name[10] = ; 3 printf( 請輸入姓名與年齡 : ); 4 scanf( %c %d, &name, &age); Ans: 第 4 行, 正確為 scanf( %s %d, &name, &age); 要在程式中輸入姓名 (name) 與年齡 (age), 並將其印出, 請完成下面程式 1 int age; // 年齡 2 char name[10] = ; // 姓名 3 printf( 請輸入姓名與年齡 : ); Ans: scanf( %s %d, &name, &age); printf( 姓名 :%s 年齡 :%d, name, age); 範例 : 請寫一個程式可輸入學生姓名 (name), 數學成績 (math), 英文成績 (english), 國文成績 (chinese), 將上述成績平均, 並印出 Ans: char name[10]; float math; float english; float chinese; printf( 請輸入姓名, 數學成績, 英文成績, 國文成績 : ); scanf( %s %f %f %f, &name, &math, &English, &chinese); printf( 平均 : %f, (math+english+chinese)/3); 範例 : 加強前述程式功能, 不允許輸入非數字的分數 ( 輸入的分數需介於 0 ~ 100) Ans: ( 參考第三章練習 - 錄影帶出租管理程式 ) 2.4 程式撰寫規則 (1). 結構化程式撰寫的重要性 提高撰寫程式的效率 提供程式的可讀性 18

12 提高程式的可修改性 (2). 結構化程式撰寫的原則 適當的分行 char c1, c2; c1 = _getch(); // Without Echo c2 = _getche(); // With Echo putchar(c1); putchar(c2); 未分行 char c1, c2; c1 = _getch(); // Without Echo c2 = _getche(); // With Echo putchar(c1); putchar(c2); 適當的合併成一行 char c1, c2; c1 = _getch(); 適當縮排 main( ) { int i; i = 12; printf( It is %d \n,i); } 有些人習慣空 2 或 4 格, 也有人是直接用 Tab 鍵來做縮排 程式碼的註解 幫助瞭解程式 盡量使用 //" 來標示註解, 除非是多行的連續註解, 才使用 /* 與 */ 當註解太長時需要換行時, 新的一行也必須在 /* 與 */ 之間 註解越詳細越好, 但也不要浮濫, 程式充斥一堆非程式的文字, 反而影響閱讀 2.5 綜合練習 (1). 簡易成績管理程式 (02-01) 程式需求 : 預先儲存 3 位學生姓名 ( mary, james, jason ) 與學號 (101, 102, 103) 每個人分別有程設成績 (prog1~3) 計概成績(comp1~3) 英文成績(English1~3) 功能包含 (1) 輸入通行密碼 (* 選作 ) (2) 輸入成績或修改成績 (3) 查詢成績 ( 不可修改 ) (4) 顯示成績與平均 輸入成績方式 : (1) 當輸入姓名第一字時, 畫面要列出相同開頭的學生姓名 (2) 使用者可以選擇輸入完整姓名或是按數字鍵來選取 19

13 (3) 選定姓名後, 分別輸入各科成績 特殊檢查功能 (1) 姓名輸入不允許輸入數字 (2) 成績輸入不允許輸入字元 (3) 成績輸入只允許 0~100 的數字 (4) 輸入錯誤需要顯示錯誤訊息 (2). 公司各部門人員管理程式 (02-02) 練習項目 變數宣告 (int, float, char[]) 變數的運算 ( 加法 除法 型別轉換 ) 輸出函式 printf( ) 輸入函式 scanf( ) ( 合併成同一行 ) 分支 (goto) 與標籤 (label) 等待鍵盤輸入 getche() 條件式敘述 if ( 選擇性 ) 本練習要撰寫一個公司各部門人數的管理程式, 程式需求如下 : 共有 3 個部門 程式需要能提供使用者輸入各部門的人數 程式需要能自動計算 (1) 每個部門的平均人數 ( 精確到小數以下 2 位 ) (2) 公司總人數 本程式需要提供多個公司連續輸入的功能 參考 : (1) goto 敘述容易破壞程式的結構性, 故應避免使用 goto LAB1; LAB1: 20

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

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

C

C C 2017 3 14 1. 2. 3. 4. 2/95 C 1. 3/95 C I 1 // talkback.c: 2 #include 3 #include 4 #define DENSITY 62.4 5 int main(void) 6 { 7 float weight, volume; 8 int size; 9 unsigned long letters;

More information

Microsoft Word - Prog1-981.docx

Microsoft Word - Prog1-981.docx 5. 變數參照 (Memory Reference) 5.1 指標 (Pointer) (1). 指標 (Pointer) 的基本觀念 特性 內含為一 Memory Address 會因不同的機器而有不同的結果 &" 也是代表變數的位址 例如 : int var1 = 2; cout

More information

C C

C C C C 2017 3 8 1. 2. 3. 4. char 5. 2/101 C 1. 3/101 C C = 5 (F 32). 9 F C 4/101 C 1 // fal2cel.c: Convert Fah temperature to Cel temperature 2 #include 3 int main(void) 4 { 5 float fah, cel; 6 printf("please

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc 2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.

More information

C/C++ - 函数

C/C++ - 函数 C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh

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

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

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

untitled

untitled Introduction to Programming ( 數 ) Lecture 3 Spring 2005 March 4, 2005 Lecture 2 Outline 數 料 If if 狀 if 2 (Standard Output, stdout): 料. ((Standard Input, stdin): 料. 類 數 數 數 說 printf 見 數 puts 串 數 putchar

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

untitled

untitled 不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int

More information

C

C C 2017 4 1 1. 2. while 3. 4. 5. for 6. 2/161 C 7. 8. (do while) 9. 10. (nested loop) 11. 12. 3/161 C 1. I 1 // summing.c: 2 #include 3 int main(void) 4 { 5 long num; 6 long sum = 0L; 7 int status;

More information

FY.DOC

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

More information

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf (%d, & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf (%d %d 2013 18 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp, Compilation Error cin scanf Time Limit Exceeded 1: A 5 B 5 C 5 D 5 E 5 F 5 1 2013 C 1 # include 2 int main ( void ) 3 { 4 int cases, a, b,

More information

C 語言—陣列及字串

C 語言—陣列及字串 10/16 系程主講人 : 荊輔翔 概論 陣列 陣列是一個具有索引 (index) 性質的連續資料儲存空間集合 陣列中每一個資料儲存空間稱之為陣列元素 (array element); 它們都具有相同的資料名稱 資料型態 及空間大小 ; 但存取它們時則須藉由索引 ( 或稱註標 ) 來區別辨識 索引代表資料在陣列中的相對位址 ( 其計數由 0 開始, 其餘累加類推 ), 且須由中括號 [ ] 涵蓋之

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 177 [P179] (1) - [P181] [P182] (2) - for [P183] (3) - switch [P184] [P187] [P189] [P194] 178 [ ]; : : int var; : int var[3]; var 2293620 var[0] var[1] 2293620

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

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

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

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

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

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

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

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

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 ,,,,!, :, :,?,,,, 2 ( 1 ) 7 0 ( 11 ) ( 12 ) ( 13 ) ( 14 ) ( 15 ) ( 17 ) ( 18 ) ( 19 ) ( 21 ) ( 22 ) ( 23 ) ( 25 ) ( 26 ) ( 27 ) ( 29 ) ( 30 ) ( 31 ) ( 32 ) ( 33 ) ( 34 ) (

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

新・解きながら学ぶ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

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

zt

zt !!!"# $%& &() *( +, -".&"# +)% /0(," 1(234" 52&%" (6 7&80 9:0((,!! ! 210!"# $%&&%!!"# $%&&% # $%&&%!"#!"# $%& ())(* +,-,.$ /"#* $"0(1"*2 +,*.)3/ ( 4 )$,-2.$( $%& ())(* 3""2 +"* %-")$(* ""2 "- )$(.# 5(6)

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

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

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

More information

! "#$! " # $%%&#! ()*+, - %& - %.,/ - /!! ! " ! #0 $ % &0 123.! 4(5 $%%& %3 &$!!!!!!!!!!!!!!! % % - /&%.&.33!!! &! 3%% - 3 % -

! #$!  # $%%&#! ()*+, - %& - %.,/ - /!! !  ! #0 $ % &0 123.! 4(5 $%%& %3 &$!!!!!!!!!!!!!!! % % - /&%.&.33!!! &! 3%% - 3 % - ! ! "#$! " # $%%&#! ()*+, - %& - %.,/ - /!!0 0 0 0! "0 0 0 0! #0 $ - - - % - - - &0 123.! 4(5 $%%& %3 &$!!!!!!!!!!!!!!! % % - /&%.&.33!!! &! 3%% - 3 % - %.63! %%%!!! 7889!:::0 7;90 ;?!!! % % -.3.3

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

Microsoft Word - ACL chapter02-5ed.docx

Microsoft Word - ACL chapter02-5ed.docx 第 2 章神奇的質數 2.1.1 什麼是質數 1 1 1 打下好基礎 - 程式設計必修的數學思維與邏輯訓練 1 1 0 10 2 3 5 7 4 6 8 9 10 4 10000 1229 1000 168 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131

More information

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023) ( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.

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

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

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

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

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

Microsoft PowerPoint - C-Ch12.ppt

Microsoft PowerPoint - C-Ch12.ppt 檔案的輸入 輸出 12-1 輸入 輸出的基礎 理解資料流 (stream) 的概念 在 C 語言中支援各種輸出入功能的概念, 就稱為資料流 執行附加格式的輸入 輸出 printf() 和 scanf() 是用來輸出 輸入的函數 必須先引入 stdio.h 檔案才能使用這些函數 這兩個函數會以固定的格式進行輸出入, 也可以使用各種不同的轉換規格 使用固定格式的輸出 輸入函數之範例 : int main(void)

More information

Ps22Pdf

Ps22Pdf A B C D A B C D A B C D a a b c x x x x x x x x x x x x x x x x x a b c x a x x x x x x x x x x a b a b a b x x x x x x x x x x x x A B C A B C A B A B A x B C x D A B C a b c a b x x x x x x x A B A

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

山东2014第四季新教材《会计基础》冲刺卷第三套

山东2014第四季新教材《会计基础》冲刺卷第三套 2016 年 会 计 从 业 考 试 会 计 基 础 冲 刺 卷 3 一 单 项 选 择 题 ( 本 题 共 20 小 题, 每 小 题 1 分, 共 20 分 在 下 列 每 小 题 的 备 选 项 中, 有 且 只 有 一 个 选 项 是 最 符 合 题 目 要 求 的, 请 将 正 确 答 案 前 的 英 文 字 母 填 入 题 后 的 括 号 内, 不 选 错 选 均 不 得 分 ) 1.

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

Ps22Pdf

Ps22Pdf C ( CIP) C /. :, 2001. 7 21 ISBN 7-5624 -2355-5. C........ C. TP312 CIP ( 2001 ) 034496 C * * : 7871092 1 /16 : 14. 25 : 356 20017 1 20017 1 : 1 6 000 ISBN 7-5624-2355-5 / TP311 : 21. 00 C, C,,,, C,, (

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

Microsoft Word - CS-981.doc

Microsoft Word - CS-981.doc 4. 資料表示法 4.1 十進位與數字系統 (1). 基本觀念 數字系統的觀念 人們習慣以十進位的計量方式來計算 不同的數字系統有二進位 (Binary) 八進位 (Octal) 十進位 (Decimal) 十六進位(Hexadecimal) 二進位 電腦內部用來表達訊號的資料只有兩種符號 : 0 表示沒電,1 表示有電透過多個電路的組合表示出無數符號, 電腦便利用這些符號來表示不同的數字 利用兩條電線可以表示出

More information

5. 閱 讀 下 文, 推 斷 內 最 適 合 填 入 的 詞 語 依 序 為 何? 人 也 真 是 一 個 絕 字, 一 邊 向 左, 一 邊 向 右, 一 副 的 樣 子, 偏 又 相 連 著, 各 說 各 話 各 走 各 路, 卻 又 人, 這 麼 一 個 簡 單 的 字, 竟 包 含 如 此

5. 閱 讀 下 文, 推 斷 內 最 適 合 填 入 的 詞 語 依 序 為 何? 人 也 真 是 一 個 絕 字, 一 邊 向 左, 一 邊 向 右, 一 副 的 樣 子, 偏 又 相 連 著, 各 說 各 話 各 走 各 路, 卻 又 人, 這 麼 一 個 簡 單 的 字, 竟 包 含 如 此 103 學 年 度 四 技 二 專 統 一 入 學 測 驗 國 文 試 題 一 選 擇 題 ( 一 ) 綜 合 測 驗 20 題 1. 下 列 各 組 內 的 字, 何 者 讀 音 不 同? (A) 諮 諏 善 道 / 渡 大 海, 入 荒 陬 (B) 傴 僂 提 攜 / 嘔 啞 嘲 哳 難 為 聽 (C) 跫 音 不 響 / 秋 蟬 兒 噪 罷 寒 蛩 兒 叫 (D) 形 容 枯 槁 / 阿 縞

More information

就 构 成 了 盗 窃 罪 与 破 坏 交 通 设 施 罪 的 想 象 竞 合, 按 照 其 中 处 罚 较 重 的 犯 罪 处 罚 5. 答 案 :B 本 题 主 要 考 察 如 何 区 分 收 买 被 拐 卖 的 妇 女 儿 童 罪 与 拐 卖 妇 女 儿 童 罪 的 共 犯 问 题 ( 对 向

就 构 成 了 盗 窃 罪 与 破 坏 交 通 设 施 罪 的 想 象 竞 合, 按 照 其 中 处 罚 较 重 的 犯 罪 处 罚 5. 答 案 :B 本 题 主 要 考 察 如 何 区 分 收 买 被 拐 卖 的 妇 女 儿 童 罪 与 拐 卖 妇 女 儿 童 罪 的 共 犯 问 题 ( 对 向 新 东 方 全 国 法 律 硕 士 ( 非 法 学 ) 联 考 模 拟 考 试 专 业 基 础 课 答 案 解 析 一 单 项 选 择 题 1. 答 案 D 本 题 主 要 考 查 刑 法 分 则 中 关 于 亲 告 罪 与 非 亲 告 罪 的 规 定 要 注 意 这 些 亲 告 罪 在 有 特 别 的 情 况 下, 是 公 诉 犯 罪 我 国 刑 法 共 规 定 了 5 种 告 诉 才 处 理 的

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

<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

! "#$%& $()*+#$, $(-.&,./.+#/(-.&01( &-#&(&$# (&2*(,#-3.,14& $ +()5(*-#5(-#/-/#(-1#&-+)(& :;<<= > A B?

! #$%& $()*+#$, $(-.&,./.+#/(-.&01( &-#&(&$# (&2*(,#-3.,14& $ +()5(*-#5(-#/-/#(-1#&-+)(& :;<<= >  A B? ! "#$%& $()*+#$, $(-.&,./.+#/(-.&01( &-#&(&$# (&2*(,#-3.,14& $ +()5(*-#5(-#/-/#(-1#&-+)(&- 67789:;

More information

C/C++ - 字符串与字符串函数

C/C++ - 字符串与字符串函数 C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed

More information

Microsoft Word - chap13.doc

Microsoft Word - chap13.doc ï FILE dã Ä o rô qî ô Ö ƒù å o ô ÃÓ FILE Ã Ù Ö o v-> ª w ï FILE d wã +1 ~ c:\temp w Õx test.dat Ã Û vä à n ïw à test.dat 13-2a /* File name: ex13-2a.c */ #include char ch; fptr = fopen("c:\\temp\\test.dat",

More information

九十六學年度第一學期第三次定期考國文科試題

九十六學年度第一學期第三次定期考國文科試題 凡 答 案 卡 上 因 個 人 基 本 資 料 畫 記 錯 誤 或 不 完 全, 造 成 讀 卡 過 程 無 法 判 定 身 分 者, 本 科 此 次 定 期 考 分 數 扣 3 分 一 單 選 題 ( 每 題 2 分 )36% 1.( 甲 ) 乃 覺 三 十 里 :ㄐㄩㄝˊ( 乙 ) 經 宿 方 至 :ㄙㄨˋ( 丙 ) 乾 癟 :ㄅㄧㄢˇ( 丁 ) 垂 髫 : ㄊㄧㄠˊ( 戊 ) 一 綹 短 髮

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 CHAPTER 02 2 CHAPTER 2-1 2-4 2-2 2-5 2-3 2-6 2-1 2-1-1 2-2 02 int A[3] = {10, 20, 30; A[0] 10 A[1] 20 A[2] 30 int *pa[3], A[3]; C 3 pa pa[0]pa[1]pa[2] 3 A A[0]A[1]A[2] 3 A A[0] A + i A[i] A + i &A[i]*(A

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

2011-论文选集-2.cdr

2011-论文选集-2.cdr ! "#$# $$ "#$#$$" " $% &%!$ $ "#$$ " ! "!#!$ %" #& # ( #$ ) )& )# )$ ** "& ")! ! "" # $% & &( ( # ) )** )*+ )*$ )) ))" ),+ )," -./ ) ) ) " )++ )+" )%,, !"#" $ ! " #$% & ( & ) % #$% #$% & * #$%#$% #$% (

More information

,,,,,,,,,, : 12, 2 ; 1921,,,, ( ) ( ), ( ) ( ) ( ) ( ) 1945, 44 9, 33 4 1956 1 97 14, 73 8,,, 1949,,,,,,, ( ),, ( ),,, ( ),,,,,, 2 ,,,,,,,,,,,,, ; ;,,,,,, 3 1925,,,,, ( ),,,, 1 ( ),, 1922, ( ), 1925,,

More information

考 查 知 识 点 肝 气 疏 泄 调 畅 气 机 的 作 用, 主 要 表 现 在 以 下 几 个 方 面 :(1) 促 进 血 液 与 津 液 的 运 行 输 布 ;(2) 促 进 脾 胃 的 运 化 功 能 和 胆 汁 分 泌 排 泄 ;(3) 调 畅 情 志 ;(4) 促 进 男 子 排 精

考 查 知 识 点 肝 气 疏 泄 调 畅 气 机 的 作 用, 主 要 表 现 在 以 下 几 个 方 面 :(1) 促 进 血 液 与 津 液 的 运 行 输 布 ;(2) 促 进 脾 胃 的 运 化 功 能 和 胆 汁 分 泌 排 泄 ;(3) 调 畅 情 志 ;(4) 促 进 男 子 排 精 2015 年 全 国 硕 士 研 究 生 入 学 统 一 考 试 中 医 综 合 科 目 试 题 解 析 一 A 型 题 :1~80 小 题, 每 小 题 1.5 分, 共 120 分 在 每 小 题 给 出 的 A B C D 四 个 选 项 中, 请 选 出 一 项 最 符 合 题 目 要 求 的 1. 提 出 阳 常 有 余, 阴 常 不 足 观 点 的 医 家 是 A 朱 丹 溪 B 刘 完

More information

Ps22Pdf

Ps22Pdf 990 1995 ( ),,,,,,, ( ) ( ) ;, ;,, ( ),, 2000 7 1 ( 1 ) ( 4 ) ( 6 ) ( 15 ) ( 21 ) ( 33 ) ( 36 ) ( 43 ) ( 53 ) ( 60 ) ( 65 ) ( 74 ) ( 84 ) ( 87 ) ( 92 ) ( 97 ) (100) (111) (116) (119) (122) (127) (138)

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

個 人 的 手, 拉 著 瞎 子 的 手 把 他 帶 往 村 外 的 時 候, 對 於 瞎 子 來 講, 那 個 人 的 手 和 耶 穌 的 手 有 沒 有 區 別? 沒 有! 為 什 麼 沒 有 區 別? 因 為 對 於 一 個 瞎 子 來 說, 手 和 耳 朵 就 是 他 接 觸 世 界, 瞭

個 人 的 手, 拉 著 瞎 子 的 手 把 他 帶 往 村 外 的 時 候, 對 於 瞎 子 來 講, 那 個 人 的 手 和 耶 穌 的 手 有 沒 有 區 別? 沒 有! 為 什 麼 沒 有 區 別? 因 為 對 於 一 個 瞎 子 來 說, 手 和 耳 朵 就 是 他 接 觸 世 界, 瞭 課 目 : 講 道 法 學 生 : 楊 建 偉 老 師 : 汪 院 長 時 間 :2009 年 8 月 1 日 靈 命 三 階 ( 可 8:22-26) 在 四 部 福 音 書 中, 這 是 一 段 很 特 別 的 記 載 特 別 在 什 麼 地 方 呢? 是 不 是 特 別 在 耶 穌 基 督 對 一 個 病 人 的 醫 治? 不, 在 耶 穌 三 年 半 的 服 侍 當 中, 曾 經 醫 治 數

More information

Microsoft Word - 01.DOC

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

More information

zt

zt ! ! !"" #" $ !"#$ % & " ())! "# ( ( * % & * % (+() (%, !"#$ "%& ( % !"!#$% $%&!"%! %& ( !" #$ %$!#!" & !" #$%$ &" ( ( ) * !! " #!$!! %&!! % ( ( &% )* )" ") (! !"#!"#!"$!!%!#%!&!(!(!)*!**!!%*!$* #") #")

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

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

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

extend

extend (object oriented) Encapsulation Inheritance Polymorphism Dynamic Binding (base class) (derived class) 1 class Base { int I; void X(); void Y(); class Derived: public Base { private: int j; void z(); Derived

More information

2009年挑战乔戈里

2009年挑战乔戈里 2009 年 挑 战 乔 戈 里 活 动 概 况 : 乔 戈 里 峰 海 拔 8611 米, 它 是 喀 喇 昆 仑 山 脉 的 主 峰, 是 世 界 上 第 二 高 峰, 国 外 又 称 K2 峰 乔 戈 里 峰, 国 际 登 山 界 公 认 的 攀 登 难 度 较 大 的 山 峰 之 一 乔 戈 里 峰 峰 巅 呈 金 字 塔 形, 冰 崖 壁 立, 山 势 险 峻, 在 陡 峭 的 坡 壁 上

More information

# # # # # # = #, / / / / # 4 # # # /# 02-1 / 0 /? / 0 / 0? # # / >

# # # # # # = #, / / / / # 4 # # # /# 02-1 / 0 /? / 0 / 0? # # / > # # # # # # #,, # # # # # - #. /#. / 0 #. 0 4 1. 04 0 #. ##1 2-1 0 1. 04 # # # 3 4 0 4 3 < # : # 1 0 5 5 5 # # : # 4 678 #. 0 # 0. #678 # 0 678 678 # 0 # 4 0 : =>8 # 0 =>8 # 4.?@= # 0 0 # 4 # 0 : =>8 0

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

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer

More information

zt

zt #! " #$$%& ()*+, - $% - $./001-2!& & & & "& & & & #& - - $& 3,.0& $ 4(5 #$$%$/1 #$ $.$ - 1%$/%/ % $$ -.$ - $/6.$$$. 7889!! :::& 7;9& ;? $.$ - #$# 66 7889!! :::& 7;9& >@A& >?,, B.$6#.!.1 #$$%.. #$$%.

More information

20151107083515_題目卷

20151107083515_題目卷 國 中 歷 史 B3:L6 明 代 與 盛 清 的 發 展 練 習 卷 一 單 一 選 擇 題 1. ( ) 明 清 兩 代 的 統 治 措 施 有 何 相 似 之 處? (A) 均 薙 髮 留 辮 (B) 均 種 族 歧 視 (C) 均 興 文 字 獄 (D) 均 設 特 務 機 關 2. ( ) 小 明 參 觀 北 京 的 長 陵, 領 隊 先 生 介 紹 此 乃 明 代 因 發 動 宗 室 之

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 資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection

More information

Microsoft Word - Chap02.doc

Microsoft Word - Chap02.doc 標準的輸入與輸出 2-1 字元的輸出與輸入 2-2 格式化的輸出與輸入 2-3 摘要 2-4 關鍵字 2-5 問題演練 2-6 程式實作 i 上 C 語言 這一章我們將談論標準的輸入與輸出 (standard input/output) 所謂標準的輸入與輸出, 其作用端分別為鍵盤和螢幕 除了標準的輸入與輸出外,C 語言還提供檔案的輸入與輸出, 其作用端皆為檔案, 此部份留在第十一章 : 檔案, 再加以解說

More information

Microsoft PowerPoint - ch03_AEL0080.ppt

Microsoft PowerPoint - ch03_AEL0080.ppt 3 基本資料型態 能盡物之性, 則可以贊天地之化育 可以贊天地之化育, 則可以與天地矣 中庸中庸.第二十一章第二十一章 1/88 基本資料型態 3.1 3.2 3.3 3.4 3.5 3.6 3.7 整數和浮點數變數和常數算術運算標準數學函數的運算邏輯值及其運算字元與字串位元處理運算 2/88 C++ 的資料型態 C++ 資料型態 基本資料型態 整數 int, short, long 浮點數 float,

More information

untitled

untitled 說 參 例 邏 邏 1. 說 2. 數 數 3. 8 4. 理念 李 龍老 立 1. 理 料 2. 理 料 3. 數 料 4. 流 邏 念 5. 良 6. 讀 行 行 7. 行 例 來 邏 1. 說 說 識 量 2. 說 理 類 3. 數 數 念 4. 令 5. 良 6. 流 邏 念 7. 說 邏 理 力 1. 2. 3. 4. 5. 列 念 1 參 1. ( Visual Basic 例 ) (1)

More information

Ps22Pdf

Ps22Pdf ( 98 ) C ( ) ( )158 1998 C : C C C,,, C,, : C ( ) : : (, 100084) : : : 7871092 1/ 16 :18 25 :415 : 2000 3 1 2000 3 1 : ISBN 7 302 01166 4/ T P432 : 00016000 : 22 00 ( 98 ) 20 90,,, ;,,, 1994, 1998, 160,

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

untitled

untitled MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12

More information

Microsoft PowerPoint - ch1.pptx

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

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++入門編 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

CIP /. - 1999.1 ISBN 7-81059-300-! ". #. - - - - $. D909.5-44 CIP 1999 00865 100038 850 1168 1/32 8 200 1999 1 1 2003 3 1 2003 3 1 0001-5000 180.00 15.00 !! 2003 2 1998!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 6!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

More information

中華民國青溪協會第四屆第三次理監事聯席會議資料

中華民國青溪協會第四屆第三次理監事聯席會議資料 - 1 - 中 華 民 國 第 八 屆 第 四 次 理 監 事 聯 席 會 議 程 序 表 日 期 中 華 民 國 1 0 4 年 1 2 月 1 9 日 ( 星 期 六 ) 地 點 臺 南 南 紡 夢 時 代 雅 悅 會 館 五 樓 ( 臺 南 東 區 中 華 東 路 一 段 366 號 ) 項 次 程 序 起 訖 時 間 使 用 時 間 主 持 人 或 報 告 人 報 到 16:30~17:00

More information

Microsoft PowerPoint - OPVB1基本VB.ppt

Microsoft PowerPoint - OPVB1基本VB.ppt 大 綱 0.VB 能 做 什 麼? CH1 VB 基 本 認 識 1.VB 歷 史 與 版 本 2.VB 環 境 簡 介 3. 即 時 運 算 視 窗 1 0.VB 能 做 什 麼? Visual Basic =>VB=> 程 式 設 計 語 言 => 設 計 程 式 設 計 你 想 要 的 功 能 的 程 式 自 動 化 資 料 庫 計 算 模 擬 遊 戲 網 路 監 控 實 驗 輔 助 自 動

More information