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

Size: px
Start display at page:

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

Transcription

1 C/C++

2 Table of contents 1. if 2. if else continue break 7. switch 1

3 if

4 if i // colddays.c: # include <stdio.h> int main ( void ) { const int FREEZING = 0; float temperature ; int cold_ days = 0; int all_ days = 0; printf (" Enter the list of daily low temperature.\n"); printf (" Use Celsius, and enter q to quit.\n"); while ( scanf ("%f", & temperature ) ==1) { all_ days ++; if ( temperature < FREEZING ) 2

5 if ii } cold_ days ++; } if ( all_ days!= 0) printf ("%d days total : %.1 f%% below freezing.\n", all_days, 100.0*( float ) cold_days / all_days ); if ( all_ days == 0) printf ("No data entered.\n"); return 0; 3

6 if Enter the list of daily low temperature. Use Celsius, and enter q to quit q 10 days total : 40. 0% were below freezing. 4

7 if if if ( condition ) statement if ( condition ){ statements } condition statements if while if while 5

8 if condition condition 0 if ( score >= 60) printf (" Pass!\n"); if (a > b){ a ++; printf (" You } lose. b.\n"); 6

9 if else

10 if else if ( condition ) statement1 else statement2 7

11 if else if ( condition ) statement1 else statement2 condition statement1 condition statement2 7

12 if else if else // wrong structure if (x > 0) printf (" Incrementing x ++; else printf ("x <= 0\n"); x:\n"); 8

13 if else if else // wrong structure if (x > 0) printf (" Incrementing x ++; else printf ("x <= 0\n"); x:\n"); printf if x++; if else if 8

14 if else // right structure if (x > 0){ printf (" Incrementing x ++; } else printf ("x <= 0\n"); x:\n"); 9

15 if else if num > 10 no yes num *= 2; printf("%d\n", num); 10

16 if else if else num > 10 yes printf("%d\n", num); num *= 2; 11

17 getchar() putchar() getchar() ch = getchar () ; scanf ("%c", &ch); putchar() putchar (ch); printf ("%c", ch); 12

18 getchar() putchar() scanf() printf() stdio.h 13

19 getchar() putchar() 1 // cypher1.c 2 # include <stdio.h> 3 # define SPACE 4 int main ( void ) 5 { 6 char ch; 7 ch = getchar (); 8 while (ch!= \n ) { 9 if ( ch == SPACE ) 10 putchar (ch); 11 else 12 putchar (ch +1) ; 13 ch = getchar (); 14 } 15 putchar (ch); 16 return 0; 17 } 14

20 getchar() putchar() 1 // cypher1.c 2 # include <stdio.h> 3 # define SPACE 4 int main ( void ) 5 { 6 char ch; 7 ch = getchar (); 8 while (ch!= \n ) { 9 if ( ch == SPACE ) 10 putchar (ch); 11 else 12 putchar (ch +1) ; 13 ch = getchar (); 14 } 15 putchar (ch); 16 return 0; 17 } Hello Ifmmp World Xpsme 14

21 getchar() putchar() ch = getchar (); while (ch!= \n ) {... ch = getchar (); } while (( ch = getchar ())!= \n ) {... } 15

22 getchar() putchar() ch = getchar (); while (ch!= \n ) {... ch = getchar (); } while (( ch = getchar ())!= \n ) {... } C 15

23 getchar() putchar() while ( (ch = getchar ())!= \n ) {... } 16

24 getchar() putchar() ch ch = getchar()!= getchar() ch ch = getchar() ch ch 17

25 getchar() putchar() while ( ch = getchar ()!= \n ) {... } =!= getchar()!= \n 0 1 ch ch 0 1 getchar() 18

26 ctype.h // cypher2.c # include <stdio.h> # include <ctype.h> int main ( void ) { char ch; while (( ch = getchar ())!= \n ) { if ( isalpha (ch)) putchar (ch +1) ; else putchar (ch); } putchar (ch); return 0; } 19

27 ctype.h Look! It s a programmer! Mppl! Ju t b qsphsbnnfs! 20

28 ctype.h 1: isalnum isalpha isblank iscntrl isdigit isgraph ( ) Ctrl+B 21

29 ctype.h 2: islower isprint ispunct isspace isupper isxdigit 22

30 ctype.h 3: tolower toupper 23

31 ctype.h ch tolower (ch); ch ch = tolower (ch); 24

32 360kwh 320kwh 680kwh $ /kwh $ /kwh $ /kwh 25

33 i // electric.c # include <stdio.h> # define RATE # define RATE # define RATE # define BREAK # define BREAK # define BASE1 ( RATE1 * BREAK1 ) # define BASE2 ( BASE1 + RATE2 * ( BREAK2 - BREAK1 ) ) int main ( void ) { double kwh, bill ; printf (" Please enter the kwh used.\n"); 26

34 ii } scanf ("%lf", & kwh ); if ( kwh <= BREAK1 ) bill = RATE1 * kwh ; else if ( kwh <= BREAK2 ) bill = BASE1 + RATE2 * ( kwh - BREAK1 ); else bill = BASE2 + RATE3 * ( kwh - BREAK2 ); printf (" The charge for %.1 f kwh is $ %.2 f.\n", kwh, bill ); return 0; 27

35 Please enter the kwh used. 580 The charge for kwh is $

36 if else if kwh<=break1 else kwh<=break2 yes bill=rate1*kwh bill=base2+ RATE3* (kwh-break2); yes bill=base1+ RATE2* (kwh-break1); 29

37 if ( kwh <= BREAK1 ) bill = RATE1 * kwh ; else if ( kwh <= BREAK2 ) bill = BASE1 + RATE2 * ( kwh - BREAK1 ); else bill = BASE2 + RATE3 * ( kwh - BREAK2 ); if ( kwh <= BREAK1 ) bill = RATE1 * kwh ; else if ( kwh <= BREAK2 ) bill = BASE1 + RATE2 * ( kwh - BREAK1 ); else bill = BASE2 + RATE3 * ( kwh - BREAK2 ); 30

38 if else if else else 31

39 else if if ( score < 1000) bonus = 0; else if ( score < 1500) bonus = 1; else if ( score < 2000) bonus = 2; else if ( score < 2500) bonus = 3; else bonus = 4; C

40 else if // elseif.c: # include <stdio.h> int main ( void ) { int number ; printf (" Enter an integer : "); scanf ("%d", & number ); if ( number > 6) if ( number < 12) printf (" You re close!\n"); else printf (" Sorry, you loose a turn!\n"); return 0; } 33

41 else if Enter an integer : 5 34

42 else if Enter an integer : 5 Enter an integer : 10 You re close! 34

43 else if Enter an integer : 5 Enter an integer : 10 You re close! Enter an integer : 15 Sorry, you loose a turn! 34

44 else if else if 35

45 else if if ( number > 6) if ( number < 12) printf (" You re close!\n"); else printf (" Sorry, you loose a turn!\n"); 36

46 else if else if if ( number > 6) { if ( number < 12) printf (" You re close!\n"); } else printf (" Sorry, you loose a turn!\n"); 37

47 38

48 i # include <stdio.h> # include < stdbool.h> int main ( void ) { unsigned long num, div ; bool isprime ; printf (" Enter an integer (q to quit ).\n"); while ( scanf ("%lu", & num ) == 1) { for ( div = 2, isprime = true ; div * div <= num ; div ++) { if ( num % div == 0) { if ( div * div!= num ) printf ("% lu is divisible by % lu and % lu.\n", num, div, num / div ); 39

49 ii } else printf ("%lu is divisible by %lu.\n", num, div ); isprime = false ; } } if ( isprime ) printf ("%lu is prime.\n", num ); printf (" Enter another integer ( q to quit ).\ n "); } printf (" Bye.\n"); return 0; 40

50 Enter an integer ( Enter q to quit ) is divisible by 2 and is divisible by 3 and is divisible by 4 and is divisible by 6. Enter another integer ( Enter q to quit ) is prime. Enter another integer ( Enter q to quit ) is divisible by 3 and Enter another integer ( Enter q to quit ). q Bye. 41

51 if, else 42

52 if ( condition ) statement if ( condition ) statement1 else statement2 if ( condition1 ) statement1 else if ( condition2 ) statement2 else statement3 43

53

54 44

55 // chcount.c: # include <stdio.h> # define PERIOD. int main ( void ) { int ch; int charcount = 0; while (( ch = getchar ())!= PERIOD ) { if (ch!= " && ch!= \ ) charcount ++; } printf (" There are %d non - quote characters.\n", charcount ); return 0; } 45

56 "I m fine ". There are 7 non - quote characters. 46

57 1. 2. if && charcount

58 4: &&! 48

59 4: &&! exp1 exp2 exp1 exp2 exp1 && exp2 exp1 exp2 exp1 exp2 exp1! exp1 exp1! exp1 48

60 iso646.h C99 iso646.h and && or not! 49

61 iso646.h C99 iso646.h and && or not! iso646.h if (ch!= " && ch!= \ ) charcount ++; if (ch!= " and ch!= \ ) charcount ++; 49

62 iso646.h 5: && iso646.h and or! not 50

63 ! && a > b && b > c b > d ((a > b) && (b > c)) (b > d) 51

64 C b = (5 + 3) * (9 + 6) C 52

65 C && C 53

66 while ((c = getchar ())!= && c!= \n ) 54

67 while ((c = getchar ())!= && c!= \n ) c c 54

68 while ( x ++ < 10 && x + y < 20) 55

69 while ( x ++ < 10 && x + y < 20) && x 1 55

70 if ( number!= 0 && 12/ number == 2) printf (" The number is 5 or 6.\ n"); 56

71 if ( number!= 0 && 12/ number == 2) printf (" The number is 5 or 6.\ n"); number

72 && if ( score >= 90 && score <= 100) printf (" Excellent!\n"); 57

73 if (90 <= score <= 100) printf (" Excellent!\n"); 58

74 if (90 <= score <= 100) printf (" Excellent!\n"); <= (90 <= score ) <= <= score range 58

75

76 59

77 59

78 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read, increment line count 6 if a word has been read, increment word count 7 read next character 60

79 // while (( ch = getchar ())!= STOP ) {... } 61

80 // while (( ch = getchar ())!= STOP ) {... } 61

81 getchar() STOP 62

82 63

83 63

84 c!= && c!= \n && c!= \t! isspace (c) // # include <ctype.h> c == c == \n c == \t isspace (c) // # include <ctype.h> 64

85 ( inword) 1 inword 1 inword 0 // pseudo code if c is not a whitespace and inword is false set inword to true and count the word if c is a white space and inword is true set inword to false 65

86 i // wordcnt.c: # include <stdio.h> # include <ctype.h> # include < stdbool.h> # define STOP int main ( void ) { char c; char prev ; long n_chars = 0L; int n_ lines = 0; int n_ words = 0; int p_ lines = 0; bool inword = false ; 66

87 ii printf (" Enter text ( to quit ):\n"); prev = \n ; while ((c = getchar ())!= STOP ) { n_chars ++; if (c == \n ) n_lines ++; if (! isspace (c) &&! inword ) { inword = true ; n_words ++; } if ( isspace (c) && inword ) inword = false ; prev = c; } if ( prev!= \n ) 67

88 iii } p_ lines = 1; printf (" characters = % ld, words = % d, lines = %d, ", n_chars, n_words, n_lines ); printf (" partial lines = %d\n", p_lines ); return 0; 68

89 Enter text ( to quit ): Reason is a powerful servant but an inadequate master. characters = 56, words = 9, lines = 3, partial lines = 0 69

90

91 C if else? : C 70

92 x = (y < 0)? -y : y; 71

93 x = (y < 0)? -y : y; y 0 x = -y x = y if else if (y < 0) x = -y; else x = y; 71

94 expression1? expression2 : expression3 72

95 expression1? expression2 : expression3 expression1 expression2 expression1 expression3 72

96 max = (a > b)? a : b; 73

97 if else 74

98 200 75

99 // paint.c: # include <stdio.h> # define COVERAGE 200 int main ( void ) { int sq_feet, cans ; printf (" Enter number of square feet to be painted :\n"); while ( scanf ("%d", & sq_feet )) { cans = sq_ feet / COVERAGE ; cans += ( sq_ feet % COVERAGE == 0)? 0 : 1; printf (" You need %d %s of paint.\n", cans, cans == 1? " can " : " cans "); printf (" Enter next value (q to quit ):\n"); } return 0; } 76

100 Enter number of square feet to be painted : 200 You need 1 can of paint. Enter next value ( q to quit ): 225 You need 2 cans of paint. Enter next value ( q to quit ): q 77

101 continue break

102 continue break continue break 78

103 continue break continue continue continue 79

104 continue break continue

105 continue break continue i # include <stdio.h> int main ( void ) { const float MIN = 0.0 f, MAX = f; float score ; float total = 0.0 f; int n = 0; float min = MAX, max = MIN ; printf (" Enter the first score (q to quit ): "); while ( scanf ("%f", & score ) == 1) { if ( score < MIN score > MAX ) { printf (" %.1 f is invalid. Try again : ", score ); continue ; 81

106 continue break continue ii } printf (" Accepting %.1 f:\n", score ); min = ( score < min )? score : min ; max = ( score > max )? score : max ; total += score ; n ++; printf (" Enter next score (q to quit ): "); } if (n > 0) { printf (" Average of %d scores is %.1 f.\n", n, total /n); printf (" Low = %.1f, High = %.1 f.\n", min, max ); } else 82

107 continue break continue iii } printf ("No valid scores were entered.\n"); return 0; 83

108 continue break continue Enter the first score ( q to quit ): 20 Accepting 20. 0: Enter next score ( q to quit ): is invalid. Try again : 90 Accepting 90. 0: Enter next score ( q to quit ): is invalid. Try again : q Average of 2 scores is Low = 20.0, High =

109 continue break continue while do while continue for 85

110 continue break continue count = 0; while ( count < 10) { ch = getchar (); if (ch == \n ) continue ; putchar (ch); count ++; } 10 86

111 continue break continue for ( count = 0; count < 10; count ++) { ch = getchar (); if (ch == \n ) continue ; putchar (ch); } 10 87

112 continue break break break break 88

113 continue break break 89

114 continue break break i # include <stdio.h> int main ( void ) { float length, width ; printf (" Enter the length of the rectangle : "); while ( scanf ("%f", & length ) == 1) { printf (" Length = %.2 f.\n", length ); printf (" Enter its width : "); if ( scanf ("%f", & width )!= 1) break ; printf (" Width = %.2 f;\n", width ); printf (" Area = %.2 f; \n", length * width ); 90

115 continue break break ii } printf (" Enter the length of the rectangle : " ); } printf (" Done.\n"); return 0; 91

116 continue break continue Enter the length of the rectangle : 10 Length = Enter its width : 20 Width = ; Area = ; Enter the length of the rectangle : 10 Length = Enter its width : q Done. 92

117 continue break break break for break break 93

118 continue break break int p, q; scanf ("%d", &p); while (p > 0) { printf ("%d\n", p); scanf ("%d", &q); while (q > 0) { printf ("%d\n", p*q); if (q > 100) break ; scanf ("%d", &q); } if (q > 100) break ; scanf ("%d", &p); } 94

119 switch

120 switch if ( condition1 )... else if ( condition2 )... else if ( condition3 )... else switch 95

121 switch i // animals.c # include <stdio.h> # include <ctype.h> int main ( void ) { char ch; printf (" Give a letter, and I will give you an "); printf (" animal name beginning with that letter.\n"); printf (" Please type in a letter : # to quit.\ n" ); while (( ch = getchar ())!= # ) { 96

122 switch ii if ( \n == ch) continue ; if ( islower (ch)) { switch (ch) { case a : printf (" alligator \n"); break ; case b : printf (" buffalo \n"); break ; case c : printf (" camel \n"); break ; 97

123 switch iii case d : printf (" dove \n"); break ; case e : printf (" eagle \n"); break ; default : break ; } } else printf (" I only recognize only lowercase letters.\n"); while ( getchar ()!= \n ) continue ; 98

124 switch iv } printf (" Please typer another letter or a #.\ n"); } printf (" Bye!\n"); return 0; 99

125 switch Give a letter, and I will give you an animal name beginning with that letter. Please type in a letter : # to quit. dog dove Please typer another letter or a #. a alligator Please typer another letter or a #. eff eagle Please typer another letter or a #. # Bye! 100

126 switch // switch switch ( integer expression ) { case constant1 : statements case constant2 : statements... default : statements } 101

127 switch 1 int char enum 102

128 switch // switch1. c: float is not allowed in switch # include <stdio.h> int main ( void ) { float x = 1. 1; switch (x){ case 1.1: printf (" Choice is 1"); break ; default : printf (" Choice other than 1, 2 and 3" ); break ; } return 0; } // Compiler Error : switch quantity not an integer 103

129 switch 2 break switch switch break switch 104

130 switch // switch2. c: There is no break in all cases # include <stdio.h> int main () { int x = 2; switch (x) { case 1: printf (" Choice is 1\n"); case 2: printf (" Choice is 2\n"); case 3: printf (" Choice is 3\n"); default : printf (" Choice other than 1, 2 and 3\n"); } return 0; } 105

131 switch Choice is 2 Choice is 3 Choice other than 1, 2 and 3 106

132 switch // switch3. c: There is no break in some cases # include <stdio.h> int main () { int x = 2; switch (x){ case 1: printf (" Choice is 1\n"); case 2: printf (" Choice is 2\n"); case 3: printf (" Choice is 3\n"); case 4: printf (" Choice is 4\n"); break ; default : printf (" Choice other than 1, 2, 3 and 4\n"); break ; } printf (" After Switch "); return 0; } 107

133 switch Choice is 2 Choice is 3 Choice is 4 After Switch 108

134 switch 3 case case 109

135 switch // switch4. c: A program with variable expressions in labels # include <stdio.h> int main () { int x = 2; int arr [] = {1, 2, 3}; switch (x) { case arr [0]: printf (" Choice 1\n"); case arr [1]: printf (" Choice 2\n"); case arr [2]: printf (" Choice 3\n"); } return 0; } // Compiler Error : case label does not reduce to an integer constant 110

136 switch 4 default switch 111

137 switch // switch5. c: The default block is placed above other cases. # include <stdio.h> int main () { int x = 4; switch (x) { default : printf (" Choice other than 1 and 2"); break ; case 1: printf (" Choice is 1"); break ; case 2: printf (" Choice is 2"); break ; } return 0; } 112

138 switch // switch5. c: The default block is placed above other cases. # include <stdio.h> int main () { int x = 4; switch (x) { default : printf (" Choice other than 1 and 2"); break ; case 1: printf (" Choice is 1"); break ; case 2: printf (" Choice is 2"); break ; } return 0; } Choice other than 1 and 2 112

139 switch i 5 case switch 113

140 switch i // Statements before all cases are never executed # include <stdio.h> int main () { int x = 1; switch (x) { x = x + 1; // This statement is not executed case 1: printf (" Choice is 1"); break ; case 2: printf (" Choice is 2"); break ; default : printf (" Choice other than 1 and 2"); 114

141 switch ii } break ; } return 0; Choice is 1 115

142 switch i 6 case 116

143 switch i // switch7. c: Program where two case labels have same value # include <stdio.h> int main () { int x = 1; switch (x) { case 2: printf (" Choice is 1"); break ; case 1+1: printf (" Choice is 2"); break ; } return 0; } 117

144 switch ii // Compiler Error : duplicate case value 118

145 switch # a, e, i, o, u 119

146 switch i // vowels.c: # include <stdio.h> int main ( void ) { char ch; int na, ne, ni, no, nu; na = ne = ni = no = nu = 0; printf (" Enter some text : enter # to quit.\n"); while (( ch = getchar ())!= # ) { switch (ch) { case a : case A : na ++; break ; case e : 120

147 switch ii } case E : ne ++; break ; case i : case I : ni ++; break ; case o : case O : no ++; break ; case u : case U : nu ++; break ; default : break ; } 121

148 switch iii } printf (" Number of text : %4c %4c %4c %4c\n", A, E, I, U ); printf (" %4d %4d %4d %4d\n", na, ne, ni, nu); return 0; 122

149 switch Enter some text : enter # to quit. See you tommorrow!# Number of text : A E I U

150 switch i switch case i : break ni++ I 124

151 switch ctype.h toupper() 125

152 switch ch = toupper (ch); switch (ch) { case A : na ++; break ; case E : ne ++; break ; case I : ni ++; break ; case O : no ++; break ; case U : nu ++; break ; default : break ; } 126

153 switch ch switch ( toupper (ch)) { case A : na ++; break ; case E : ne ++; break ; case I : ni ++; break ; case O : no ++; break ; case U : nu ++; break ; default : break ; } 127

154 switch switch if else switch if if ( integer < 1000 && integer > 2) switch 128

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

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

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++数据

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

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

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

C 语言 第七讲 分支 张晓平 武汉大学数学与统计学院 2017 年 4 月 5 日

C 语言 第七讲 分支 张晓平 武汉大学数学与统计学院 2017 年 4 月 5 日 C 语言 第七讲 分支 张晓平 武汉大学数学与统计学院 2017 年 4 月 5 日 1. if 语句 2. if else 语句 3. 获取逻辑性 4. 一个统计字数的程序 5. 条件运算符 6. continue 和 break 语句 2/145 C 语言 7. switch 语句 8. goto 语句 3/145 C 语言 1. if 语句 if 语句 I 1 // colddays.c: 2

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

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

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

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

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

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

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

( 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++ - 字符串与字符串函数

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

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

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

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

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

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

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

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

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

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

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

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

C/C++ - 结构体、共用体、枚举体

C/C++ - 结构体、共用体、枚举体 C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 C C (struct) C 2 C C (struct) C 2 i // book.c: # include < stdio.h> # define MAX_ TITLE 41 # define MAX_ AUTHOR 31 struct book { char title [ MAX_ TITLE

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

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

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

More information

C/C++ - 数组与指针

C/C++ - 数组与指针 C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 float candy [ 365]; char code [12]; int states [50]; 2 int array [6] = {1, 2, 4, 6, 8, 10}; 3 // day_mon1.c: # include # define MONTHS 12 int

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

穨control.PDF

穨control.PDF TCP congestion control yhmiu Outline Congestion control algorithms Purpose of RFC2581 Purpose of RFC2582 TCP SS-DR 1998 TCP Extensions RFC1072 1988 SACK RFC2018 1996 FACK 1996 Rate-Halving 1997 OldTahoe

More information

FY.DOC

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

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

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

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

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

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

WWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2

WWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2 WWW PHP 2003 1 Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2 Comments PHP Shell Style: # C++ Style: // C Style: /* */ $value = $p * exp($r * $t); # $value

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

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

ebook14-4

ebook14-4 4 TINY LL(1) First F o l l o w t o p - d o w n 3 3. 3 backtracking parser predictive parser recursive-descent parsing L L ( 1 ) LL(1) parsing L L ( 1 ) L L ( 1 ) 1 L 2 L 1 L L ( k ) k L L ( 1 ) F i r s

More information

1.ai

1.ai HDMI camera ARTRAY CO,. LTD Introduction Thank you for purchasing the ARTCAM HDMI camera series. This manual shows the direction how to use the viewer software. Please refer other instructions or contact

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

Computer Architecture

Computer Architecture ECE 3120 Computer Systems Assembly Programming Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Prev: Basic computer concepts

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

Microsoft Word - Final Exam Review Packet.docx

Microsoft Word - Final Exam Review Packet.docx Do you know these words?... 3.1 3.5 Can you do the following?... Ask for and say the date. Use the adverbial of time correctly. Use Use to ask a tag question. Form a yes/no question with the verb / not

More information

untitled

untitled 1 DBF (READDBF.C)... 1 2 (filetest.c)...2 3 (mousetes.c)...3 4 (painttes.c)...5 5 (dirtest.c)...9 6 (list.c)...9 1 dbf (readdbf.c) /* dbf */ #include int rf,k,reclen,addr,*p1; long brec,erec,i,j,recnum,*p2;

More information

untitled

untitled 串 串 例 : char ch= a ; char str[]= Hello ; 串 列 ch=getchar(); scanf( %c,&ch); 串 gets(str) scanf( %s,str); 8-1 數 ASCII 例 : char ch= A ; printf( %d,ch); // 65 A ascii =0x41 printf( %c,ch); // A 例 : char ch;

More information

プログラムの設計と実現II

プログラムの設計と実現II UNIX C ls mkdir man http://www.tj.chiba-u.jp/lecture/prog2/ Ctrl+x, Ctrl+s ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall

More information

Lorem ipsum dolor sit amet, consectetuer adipiscing elit

Lorem ipsum dolor sit amet, consectetuer adipiscing elit English for Study in Australia 留 学 澳 洲 英 语 讲 座 Lesson 3: Make yourself at home 第 三 课 : 宾 至 如 归 L1 Male: 各 位 朋 友 好, 欢 迎 您 收 听 留 学 澳 洲 英 语 讲 座 节 目, 我 是 澳 大 利 亚 澳 洲 广 播 电 台 的 节 目 主 持 人 陈 昊 L1 Female: 各 位

More information

C

C C 14 2017 5 31 1. 2. 3. 4. 5. 2/101 C 1. ( ) 4/101 C C ASCII ASCII ASCII 5/101 C 10000 00100111 00010000 ASCII 10000 31H 30H 30H 30H 30H 1 0 0 0 0 0 ASCII 6/101 C 7/101 C ( ) ( ) 8/101 C UNIX ANSI C 9/101

More information

Microsoft Word - 01.DOC

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

More information

Knowledge and its Place in Nature by Hilary Kornblith

Knowledge and its Place in Nature by Hilary Kornblith Deduction by Daniel Bonevac Chapter 7 Quantified Natural Deduction Quantified Natural Deduction As with truth trees, natural deduction in Q depends on the addition of some new rules to handle the quantifiers.

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

epub 33-8

epub 33-8 8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE

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

ebook39-5

ebook39-5 5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o

More information

C语言的应用.PDF

C语言的应用.PDF AVR C 9 1 AVR C IAR C, *.HEX, C,,! C, > 9.1 AVR C MCU,, AVR?! IAR AVR / IAR 32 ALU 1KBytes - 8MBytes (SPM ) 16 MBytes C C *var1, *var2; *var1++ = *--var2; AVR C 9 2 LD R16,-X ST Z+,R16 Auto (local

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++ 程式設計

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

PIC_SERVER (11) SMTP ( ) ( ) PIC_SERVER (10) SMTP PIC_SERVER (event driven) PIC_SERVER SMTP 1. E-

PIC_SERVER (11) SMTP  ( ) ( ) PIC_SERVER (10) SMTP  PIC_SERVER (event driven)  PIC_SERVER SMTP  1.  E- (2005-02-01) (2005-04-28) PIC_SERVER (10) SMTP E-mail PIC_SERVER (event driven) E-mail PIC_SERVER SMTP E-mail 1. E-mail E-mail 1 (1) (2) (3) (4) 1 1. 2 E-mail A E-mail B E-mail SMTP(Simple Mail Transfer

More information

BC04 Module_antenna__ doc

BC04 Module_antenna__ doc http://www.infobluetooth.com TEL:+86-23-68798999 Fax: +86-23-68889515 Page 1 of 10 http://www.infobluetooth.com TEL:+86-23-68798999 Fax: +86-23-68889515 Page 2 of 10 http://www.infobluetooth.com TEL:+86-23-68798999

More information

第7章-并行计算.ppt

第7章-并行计算.ppt EFEP90 10CDMP3 CD t 0 t 0 To pull a bigger wagon, it is easier to add more oxen than to grow a gigantic ox 10t 0 t 0 n p Ts Tp if E(n, p) < 1 p, then T (n) < T (n, p) s p S(n,p) = p : f(x)=sin(cos(x))

More information

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E Gerotor Motors Series Size CC-A Flange Options-B Shaft Options-C Ports Features 0 0 5 5 1 0 1 0 3 3 0 0 SAE A 2 Bolt - (2) 4 Bolt Magneto (4) 4 Bolt Square (H4) 1.0" Keyed (C) 25mm Keyed (A) 1.0' 6T Spline

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

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

致 谢 本 论 文 能 得 以 完 成, 首 先 要 感 谢 我 的 导 师 胡 曙 中 教 授 正 是 他 的 悉 心 指 导 和 关 怀 下, 我 才 能 够 最 终 选 定 了 研 究 方 向, 确 定 了 论 文 题 目, 并 逐 步 深 化 了 对 研 究 课 题 的 认 识, 从 而 一

致 谢 本 论 文 能 得 以 完 成, 首 先 要 感 谢 我 的 导 师 胡 曙 中 教 授 正 是 他 的 悉 心 指 导 和 关 怀 下, 我 才 能 够 最 终 选 定 了 研 究 方 向, 确 定 了 论 文 题 目, 并 逐 步 深 化 了 对 研 究 课 题 的 认 识, 从 而 一 中 美 国 际 新 闻 的 叙 事 学 比 较 分 析 以 英 伊 水 兵 事 件 为 例 A Comparative Analysis on Narration of Sino-US International News Case Study:UK-Iran Marine Issue 姓 名 : 李 英 专 业 : 新 闻 学 学 号 : 05390 指 导 老 师 : 胡 曙 中 教 授 上 海

More information

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

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

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

TX-NR3030_BAS_Cs_ indd

TX-NR3030_BAS_Cs_ indd TX-NR3030 http://www.onkyo.com/manual/txnr3030/adv/cs.html Cs 1 2 3 Speaker Cable 2 HDMI OUT HDMI IN HDMI OUT HDMI OUT HDMI OUT HDMI OUT 1 DIGITAL OPTICAL OUT AUDIO OUT TV 3 1 5 4 6 1 2 3 3 2 2 4 3 2 5

More information

* RRB *

* RRB * *9000000000RRB0010040* *9000000000RRB0020040* *9000000000RRB0030040* *9000000000RRB0040040* *9000000000RRC0010050* *9000000000RRC0020050* *9000000000RRC0030050* *9000000000RRC0040050* *9000000000RRC0050050*

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

Guide to Install SATA Hard Disks

Guide to Install SATA Hard Disks SATA RAID 1. SATA. 2 1.1 SATA. 2 1.2 SATA 2 2. RAID (RAID 0 / RAID 1 / JBOD).. 4 2.1 RAID. 4 2.2 RAID 5 2.3 RAID 0 6 2.4 RAID 1.. 10 2.5 JBOD.. 16 3. Windows 2000 / Windows XP 20 1. SATA 1.1 SATA Serial

More information

国防常识

国防常识 ...1...14...14...18...19...26...28...30...31 97...40...40...41...42 ()...43...43...44...44...45...46 I ...47...47...48...49...49...52...53...54...54...55...57...58...59...61...62...62...64...66...68...69...72

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

2009 Japanese First Language Written examination

2009 Japanese First Language Written examination Victorian Certificate of Education 2009 SUPERVISOR TO ATTACH PROCESSING LABEL HERE STUDENT NUMBER Letter Figures Words JAPANESE FIRST LANGUAGE Written examination Monday 16 November 2009 Reading time:

More information

White Paper 2014 届 毕 业 生 内 部 资 料 严 禁 抄 袭 非 经 允 许 不 得 翻 印 就 业 状 况 白 皮 书 就 业 创 业 指 导 中 心 2015 年 5 月 目 录 第 一 部 分 毕 业 生 基 本 情 况... 1 一 2014 届 毕 业 生 基 本 情 况... 1 1 性 别 比 例... 1 2 学 历 类 别... 2 二 初 次 签 约 就 业

More information

untitled

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

More information

2010 Japanese First Language Written examination

2010 Japanese First Language Written examination Victorian Certificate of Education 2010 SUPERVISOR TO ATTACH PROCESSING LABEL HERE STUDENT NUMBER Letter Figures Words JAPANESE FIRST LANGUAGE Written examination Monday 15 November 2010 Reading time:

More information

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn Xi III Zebra XI III 1 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn 230V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666

More information

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un Linux C July 27, 2016 Contents 1 Linux IDE 1 2 GCC 3 2.1 hello.c hello.exe........................... 5 2.2............................... 9 2.2.1 -Wall................................ 9 2.2.2 -E..................................

More information

2009 Korean First Language Written examination

2009 Korean First Language Written examination Victorian Certificate of Education 2009 SUPERVISOR TO ATTACH PROCESSING LABEL HERE STUDENT NUMBER Letter Figures Words KOREAN FIRST LANGUAGE Written examination Tuesday 20 October 2009 Reading time: 2.00

More information

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING 前言 - Andrew Payne 目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX 目录 4 RESOURCES 致谢

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

PowerPoint Presentation

PowerPoint Presentation Visual Basic 2005 學 習 範 本 第 7 章 陣 列 的 活 用 7-1 陣 列 當 我 們 需 要 處 理 資 料 時, 都 使 用 變 數 來 存 放 資 料 因 為 一 個 變 數 只 能 代 表 一 個 資 料, 若 需 要 處 理 100 位 同 學 的 成 績 時, 便 要 使 用 100 個 不 同 的 變 數 名 稱, 這 不 但 會 增 加 變 數 名 稱 命 名

More information

技 巧 5: 避 免 除 以 0 的 運 算 在 做 除 的 運 算 時, 先 檢 查 除 數 的 數 值, 避 免 有 除 以 0 的 情 況 若 運 算 中 除 數 為 0,SAS 會 在 LOG 中 註 記 提 醒 並 將 運 算 結 果 設 定 為 遺 漏 值, 減 慢 程 式 的 執 行

技 巧 5: 避 免 除 以 0 的 運 算 在 做 除 的 運 算 時, 先 檢 查 除 數 的 數 值, 避 免 有 除 以 0 的 情 況 若 運 算 中 除 數 為 0,SAS 會 在 LOG 中 註 記 提 醒 並 將 運 算 結 果 設 定 為 遺 漏 值, 減 慢 程 式 的 執 行 提 升 SAS 效 率 的 小 技 巧 ( 二 ) 統 計 分 析 師 嚴 友 君 在 使 用 SAS 的 時 候, 效 率 的 考 量 除 了 程 式 運 行 的 時 間, 還 包 括 資 料 佔 用 的 空 間 暫 存 記 憶 體 的 使 用 量 程 式 的 長 度 與 易 讀 性 等 等 以 下 介 紹 一 些 初 學 者 容 易 應 用, 且 在 討 論 使 用 SAS 處 理 分 析 資

More information

Microsoft Word - 1041106

Microsoft Word - 1041106 輔 仁 大 學 經 費 核 銷 作 業 須 知 中 華 民 國 一 百 零 四 年 八 月 目 錄 一 報 帳 流 程... 3 二 憑 證 種 類 及 內 容... 7 三 憑 證 範 例... 10 四 經 費 核 銷 要 點... 15 五 常 見 錯 誤... 18 六 相 關 法 規... 19 輔 仁 大 學 預 算 執 行 辦 法... 20 輔 仁 大 學 採 購 作 業 辦 法...

More information

2015 Chinese FL Written examination

2015 Chinese FL Written examination Victorian Certificate of Education 2015 SUPERVISOR TO ATTACH PROCESSING LABEL HERE Letter STUDENT NUMBER CHINESE FIRST LANGUAGE Written examination Monday 16 November 2015 Reading time: 11.45 am to 12.00

More information

条款

条款 中 银 保 险 有 限 公 司 国 内 贸 易 信 用 保 险 (C 款 ) 条 款 1. 承 保 范 围 1.01 被 保 险 人 所 获 得 的 保 障 我 们 是 特 别 条 款 中 所 称 的 保 险 人 我 们 向 您, 即 特 别 条 款 中 所 称 的 被 保 险 人, 签 发 本 保 单, 并 就 本 保 单 收 取 保 险 费 根 据 保 单 的 条 款 和 条 件, 如 果 由

More information

業 用 地 出 讓 最 低 價 標 準 不 得 低 於 土 地 取 得 成 本 土 地 前 期 開 發 成 本 和 按 規 定 收 取 的 相 關 費 用 之 和 工 業 用 地 必 須 採 用 招 標 拍 賣 掛 牌 方 式 出 讓 其 出 讓 價 格 不 得 低 於 公 佈 的 最 低 價 標

業 用 地 出 讓 最 低 價 標 準 不 得 低 於 土 地 取 得 成 本 土 地 前 期 開 發 成 本 和 按 規 定 收 取 的 相 關 費 用 之 和 工 業 用 地 必 須 採 用 招 標 拍 賣 掛 牌 方 式 出 讓 其 出 讓 價 格 不 得 低 於 公 佈 的 最 低 價 標 我 們 為 一 間 所 有 運 營 均 在 中 國 進 行 的 甲 級 物 流 設 施 供 應 商 以 下 為 對 我 們 在 中 國 的 業 務營運有重大關係的中國法律及法規概要 項目的開發 開發用地 儘 管 中 國 的 所 有 土 地 均 歸 國 家 或 集 體 所 有 然 而 個 人 及 企 業 可 獲 得 土 地 使 用 權 及 持 有 有關土地使用權作開發用途 全 國 人 民 代 表 大

More information

2015年计算机二级(C语言)模拟试题及答案(四)

2015年计算机二级(C语言)模拟试题及答案(四) 2016 年 计 算 机 二 级 (C 语 言 ) 模 拟 试 题 及 答 案 (4) 一 填 空 题 1 C 语 言 中 基 本 的 数 据 类 型 有 : 2 C 语 言 中 普 通 整 型 变 量 的 类 型 说 明 符 为, 在 内 存 中 占 字 节, 有 符 号 普 通 整 型 的 数 据 范 围 是 3 整 数 -35 在 机 内 的 补 码 表 示 为 4 执 行 下 列 语 句 int

More information

3. 給 定 一 整 數 陣 列 a[0] a[1] a[99] 且 a[k]=3k+1, 以 value=100 呼 叫 以 下 兩 函 式, 假 設 函 式 f1 及 f2 之 while 迴 圈 主 體 分 別 執 行 n1 與 n2 次 (i.e, 計 算 if 敘 述 執 行 次 數, 不

3. 給 定 一 整 數 陣 列 a[0] a[1] a[99] 且 a[k]=3k+1, 以 value=100 呼 叫 以 下 兩 函 式, 假 設 函 式 f1 及 f2 之 while 迴 圈 主 體 分 別 執 行 n1 與 n2 次 (i.e, 計 算 if 敘 述 執 行 次 數, 不 1. 右 側 程 式 正 確 的 輸 出 應 該 如 下 : * *** ***** ******* ********* 在 不 修 改 右 側 程 式 之 第 4 行 及 第 7 行 程 式 碼 的 前 提 下, 最 少 需 修 改 幾 行 程 式 碼 以 得 到 正 確 輸 出? (A) 1 (B) 2 (C) 3 (D) 4 1 int k = 4; 2 int m = 1; 3 for (int

More information

星河33期.FIT)

星河33期.FIT) 大 事 记 渊 2011.11 要 要 2011.12 冤 1 尧 11 月 25 日 下 午 袁 白 银 区 首 届 中 小 学 校 长 论 坛 在 我 校 举 行 遥 2 尧 在 甘 肃 省 2011 年 野 十 一 五 冶 规 划 课 题 集 中 鉴 定 中 袁 我 校 教 师 郝 香 梅 负 责 的 课 题 叶 英 语 课 堂 的 艺 术 性 研 究 曳 袁 张 宏 林 负 责 的 叶 白

More information

項 訴 求 在 考 慮 到 整 體 的 財 政 承 擔 以 及 資 源 分 配 的 公 平 性 下, 政 府 採 取 了 較 簡 單 直 接 的 一 次 性 減 稅 和 增 加 免 稅 額 方 式, 以 回 應 中 產 家 庭 的 不 同 訴 求 ( 三 ) 取 消 外 傭 徵 費 6. 行 政 長

項 訴 求 在 考 慮 到 整 體 的 財 政 承 擔 以 及 資 源 分 配 的 公 平 性 下, 政 府 採 取 了 較 簡 單 直 接 的 一 次 性 減 稅 和 增 加 免 稅 額 方 式, 以 回 應 中 產 家 庭 的 不 同 訴 求 ( 三 ) 取 消 外 傭 徵 費 6. 行 政 長 2013 年 1 月 23 日 的 立 法 會 會 議 葛 珮 帆 議 員 就 幫 助 中 產 動 議 的 議 案 ( 經 單 仲 偕 議 員 及 莫 乃 光 議 員 修 正 ) 進 度 報 告 在 2013 年 1 月 23 日 的 立 法 會 會 議 上, 由 葛 珮 帆 議 員 就 幫 助 中 產 動 議 的 議 案, 經 單 仲 偕 議 員 及 莫 乃 光 議 員 修 正 後 獲 得 通 過

More information

(f) (g) (h) (ii) (iii) (a) (b) (c) (d) 208

(f) (g) (h) (ii) (iii) (a) (b) (c) (d) 208 (a) (b) (c) (d) (e) 207 (f) (g) (h) (ii) (iii) (a) (b) (c) (d) 208 17.29 17.29 13.16A(1) 13.18 (a) (b) 13.16A (b) 12 (a) 209 13.19 (a) 13.16A 12 13.18(1) 13.18(4) 155 17.43(1) (4) (b) 13.19 17.43 17.29

More information