ebook39-5

Size: px
Start display at page:

Download "ebook39-5"

Transcription

1 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 C [ ] 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 t t o m A b o t t o m A b o t t o m a ) b ) c ) 5-1

2 162 A D T ADT 5-1 ADT5-1 S t a c k{ C re a t e( ) I s E m p t y( ) t r u e f a l s e I s F u l l( ) t r u e f a l s e To p( ) A d d(x) x D e l e t e(x) x 5.2 C + + B A B A B A B A B A B A class B: public A B A C A C class B: public A, private C A A B B A A B A B B A A X B F B A X. F X F A B X F F B X.. F () A B

3 v i r t u a l e l e m e n t [ l e n g t h - 1 ] e l e m e n t [ S t a c k 3-1 L i n e a r L i s t L i n e a r L i s t S t a c k L i n e a r L i s t S t a c k 5-1 template<class T> class Stack :: private LinearList <T>{ // LIFO ; p u b l i c : Stack(int MaxStackSize = 10) L i n e a r L i s t < T > ( M a x S t a c k S i z e ) { bool IsEmpty() const {return LinearList<T>::IsEmpty(); bool IsFull() const {return (Length() == GetMaxSize()); T Top() const {if (IsEmpty()) throw OutOfBounds(); T x; Find(Length(), x); return x; Stack<T>& Add(const T& x) {Insert(Length(), x); return *this; Stack<T>& Delete(T& x) { L i n e a r L i s t < T > : : D e l e t e (Length(), x); return *this; S t a c k M a x S t a c k S i z e S t a c k S t a c k L i n e a r L i s t I s E m p t y () :: I s F u l l S t a c k L i n e a r L i s t L i n e a r L i s t < T > :: M a x S i z e M a x S i z L i n e a r L i s t L i n e a r L i s M a x S i z e S t a c k L i n e a r L i s t G e t M a x S i z e () p r o t e c t e d : int GetMaxSize() const {return MaxSize; S t a c k L i n e a r L i s t G e t M a x S i z e L i n e a r L i s t I s F u l l 5-1 S t a c k < T > :: I s F u l l L i n e a r L i s t < T > :: L e n g t h () S t a c k

4 164 L e n g t h () To p O u t O f B o u n d s F i n d A d d x x D e l e t e x A d d D e l e t e A d d D e l e t e I n s e r t L i n e a r L i s t : : D e l e t e X S t a c k F S t a c k X X. F L i n e a r L i s t L e n g t h X. F L i n e a r L i s t S t a c k Stack T ( 1 ) O ( M a x S t a c k S i z e ) ( 1 ) L i n e a r L i s t S t a c k L i n e a r L i s t l e n g t h () I n s e r t () I n s e r t f o r 0 S t a c k S t a c k L i n e a r L i s t T < < = = < < L i n e a r L i s t : : S e a r c h S t a c k 5-2 S t a c k s t a c k t o p M a x To p S t a c k template<class T> class Stack{ // LIFO p u b l i c : Stack(int MaxStackSize = 10); ~Stack () {delete [] stack; bool IsEmpty() const {return top == -1; bool IsFull() const {return top == MaxTo p ; T Top() const; Stack<T>& Add(const T& x); Stack<T>& Delete(T& x); p r i v a t e : int top; // int MaxTop; //

5 ; T *stack; template<class T> // Stack<T>::Stack(int MaxStackSize) {// Stack M a x Top = MaxStackSize - 1; stack = new T[MaxStackSize]; top = -1; template<class T> T Stack<T>::Top() const {// if (IsEmpty()) throw OutOfBounds(); else return stack[top]; template<class T> Stack<T>& Stack<T>::Add(const T& x) {// x if (IsFull()) throw NoMem(); stack[++top] = x; return *this; template<class T> Stack<T>& Stack<T>::Delete(T& x) {// x if (IsEmpty()) throw OutOfBounds(); x = stack[top--]; return *this; f o r % 1. A D T 1) 2) 3) 2. A D T 1) 2) 3. M a x S t a c k S i z e

6 166 M a x To p = 0 A d d M a x To p 2 * M a x To p + 1 M a x To p + 1 / 4 1) S t a c k M a x To p = 0 1 t o p 2) n f (n) cf c M a x S i z e A d d ( 1 ) O ( A r r a y S i z e ) D e l e t e ( 1 ) ( 1 ) I n s e r t ( n, x ) D e l e t e ( n, x ) n ( n ) I n s e r t ( 0, x ) D e l e t e ( 1, x ) ( 1 ) 5-3 C h a i n 5-3 C h a i n template<class T> class LinkedStack : private Chain<T> { p u b l i c :

7 ; bool IsEmpty() const {return Chain<T>::IsEmpty(); bool IsFull() const; T Top() const {if (IsEmpty()) throw OutOfBounds(); T x; Find(1, x); return x; LinkedStack<T>& Add(const T& x) {Insert(0, x); return *this; LinkedStack<T>& Delete(T& x) {Chain<T>::Delete(1, x); return *this; template<class T> bool LinkedStack<T>::IsFu11() const {//? try {ChainNode<T> *p = new ChainNode<T>; delete p; return false; catch (NoMem) {return true; I s F u l l N o d e f o r % 5-4 template <class T> class Node{ friend LinkedStack<T>; p r i v a t e : T data; Node<T> *link; ; template<class T> class LinkedStack { p u b l i c : LinkedStack () {top = 0; ~ L i n k e d S t a c k (); bool IsEmpty() const {return top==0; bool IsFull() const; T Top() const; LinkedStack<T>& Add(const T& x); LinkedStack<T>& Delete(T& x); p r i v a t e : Node<T> *top; // : template<class T> L i n k e d S t a c k < T > :: ~ L i n k e d S t a c k ()

8 168 {// Node<T> *next; while (top) { next = top->link; delete top; top = next; template<class T> bool LinkedStack<T>::IsFu11() const {//? try {Node<T> *p = new Node<T>; delete p; return false; catch (NoMem) {return true; template<class T> T LinkedStack<T>::Top() const {// if (IsEmpty()) throw OutOfBounds(); return top->data; template<class T> LinkedStack<T>& LinkedStack<T>::Add(const T& x) {// x Node<T> *p = new Node<T>; p->data = x; p->link = top; top = p; return *this; template<class T> LinkedStack<T>& LinkedStack<T>::Delete(T& x) {// x if (IsEmpty()) throw OutOfBounds(); x = top->data; Node<T> *p = top; top = top->link; delete p; return *this; 4. 1) ) L i n k e d S t a c k

9 ) 2) 3) 6. L i n k e d S t a c k 1) 2) ( a *( b + c ) + d ) ( a + b ))( 6 7 C + + C + + { 5-5 C / 5-5 (n) n 5-5 #include <iostream.h> #include <string.h> #include <stdio.h> #include "stack.h" const int MaxLength = 100; // void PrintMatchedPairs(char *expr) {// Stack<int> s(maxle n g t h ) ; int j, length = strlen(expr); // expr ( ) for (int i = 1; I<=length; i++) { if (expr[i - 1] ==' ( ' ) s.add(i); else if (expr[i - 1] ==' ) ' ) t r y { s. D e l e t e ( j ) ; cout << j <<' ' << i << endl; catch (OutOfBounds) { cout << "No match for right parenthesis" << " at " << i << endl; // ( while(!s.isempty()) {

10 170 s. D e l e t e ( j ); cout << "No match for left parenthesis at " <<j< endl; void main(void) { char expr[maxlength]; cout << "Type an expression of length at most " << MaxLength << endl; c i n. g e t l i n e ( e x p r, MaxLength); cout <<"The pairs of matching parentheses in" << endl; puts (expr); cout <<"are" << endl; P r i n t M a t c n e d P a i r s ( e x p r ); Type an expression of length at most 100 ( d + ( a + b )* c *( d + e )- f ))(() The pairs of matching parentheses in the expression ( d + ( a + b )* c *( d + e )- f ))(() a r e No match for right parenthesis at No match for left parenthesis at Towers of Hanoi n n= 2, n n C + + To w e r s O f H a n o i ( n, 1, 2, 3 ) 5-6

11 void TowersOfHanoi(int n, int x, int y, int z) {// n x y z if (n > 0) { TowersOfHanoi(n-1, x,z,y); cout << "Move top disk from tower " << x <<" to top of tower " << y << endl; TowersOfHanoi(n-l, z, y, x); moves (n) m o v es (n) = 2 n n - 1 n= 64 To w e r s O f H a n o i ( 2 n ) L I F O n n 1 2 n 3 n- 1 3n- 1 n n n 3 0 n

12 To w e r s O f H a n o i ( n ) H a n o i :: To w e r s O f H a n o i 5-6 S [ 1 : 3 ] 3 1 n i n t N o M e m H a n o i :: To w e r s O f H a n o i H a n o i :: To w e r s O f H a n o i S h o w S t a t e 5-7 class Hanoi{ ; friend void To w e r s O f H a n o i ( i n t ) ; p u b l i c : void TowersOfHanoi(int n, int x, int y, int z); p r i v a t e : Stack<int> *S[4]; void Hanoi::TowersOfHanoi(int n, int x, int y, int z) {// n x y z int d; // if (n > 0) { TowersOfHanoi(n-l, x, z, y); S[x]->Delete(d); // x S[y]->Add(d); // y S h o w S t a t e ( ) ; TowersOfHanoi(n-l, z, y, x); void TowersOfHanoi(int n) {// Hanoi::towersOfHanoi Hanoi X X.S[1] = new Stack<int> (n); X.S[2] = new Stack<int> (n); X.S[3] = new Stack<int> (n); for (int d = n; d > 0; d--) // X.S[1]->Add(d); // d 1 // 1 n 3 2 X. TowersOfHanoi(n, 1, 2, 3); n 1 ~n 1 1 n

13 k 5-5a k= 3 H1 H2 H3 n 1 n 5-5a n= b a) b) 5-5 a) b) L I F O 5-5 a H1 6 6 H H2 9 H3 H1 H2 5-6a a) b) H1 H H2 4 H u

14 174 v v > u v assignment rule H2 7 H3 5-6b 1 H1 2 H1 3 H2 4 8 H1 5 H2 6 H3 7 H1 8 H a 1, n, n-1,..., 2 n- 1 k k n - 1 R a i l r o a d 5-8 n k p [ 1 : n ] R a i l r o a d f a l s e t r u e N o M e m R a i l r o a d H H [ i ] i 1 i k N o w O u t m i n H m i n S m i n f o r i p [ i ] p [ i ] = N o w O u t N o w O u t 1 w h i l e p [ i ] p [ i ] 5-8 bool Railroad(int p[], int n, int k) {// k p [ 1 : n ] // t r u e false // NoMem / / LinkedStack<int> *H; H = new LinkedStack<int> [k + 1]; int NowOut = 1; // int minh = n+l; // int mins; //minh / / for (int i = 1; i <= n; i++) if (p[i] == NowOut) {// t cout << "Move car " << p[i] << " from input to output" << endl; N o w O u t + + ; / / while (minh == NowOut) { Output(minH, mins, H, k, n);

15 N o w O u t + + ; else {// p[i] if (!Hold(p[i], minh, mins, H, k, n)) return false; return true; R a i l r o a d O u t p u t H o l d O u t p u t m i n S m i n H H o l d c m i n S m i n H Output void Output(int& minh, int& mins, LinkedStack<int> H[ ], int k, int n) {// m i n S m i n H int c; // // m i n S minh H [ m i n S ]. D e l e t e ( c ) ; cout << "Move car " << minh << " from holding track " << mins << " to output" << endl; // m i n H m i n S minh = n + 2; for (int i = 1; i <= k; i++) if (!H[i].IsEmpty() && (c = H[i].Top()) < minh) { minh = c; mins = i; H o l d bool Hold(int c, int& minh, int &mins, LinkedStack<int> H[], int k, int n) (// c // false // N o M e m // true // c // int BestTrack = 0, // B e s t Top = n + 1, // x;// / / for (int i = 1; i <= k; i++) if (!H[i].IsEmpty()) {// i x = H[i].To p ( ) ; if (c < x && x < BestTop) { // i B e s t Top = x; B e s t Track = i;

16 176 else // i if (!BestTrack) BestTrack = i; if (!BestTrack) return false; // // c H [ B e s t Tr a c k ]. A d d ( c ) ; cout << "Move car " << c << " from input " "to holding track " << BestTrack << endl; // minh mins if (c < minh) {minh = c; mins = BestTr a c k ; return true; 5-8 O u t p u t H o l d ( k ) R a i l r o a d w h i l e n - 1 e l s e n - 1 O u t p u t H o l d O ( k n ) R a i l r o a d f o r ( n ) 5-8 O ( k n ) AV L 11 O ( n l o g k ) O u t p u t H o l d O ( l o g k ) k a ( 1, 4,) ( 2, 3 ) ( 5, 6 ) ( 7, 8 ) 5-7b (1,4) (2,3) 5-7c routable switch box a) b) c) b 5-7c x y x y

17 ( 1, 4 ) ~ a 1, 2,..., a ( 1, 5 ) ( 2, 3 ) ( 4, 7 ) ( 6, 8 ) C c n et= [ 1, 2, 2, 1, 3, 3, 4, 4 ] 5-11 ( n ) n 5-11 bool CheckBox(int net[ ], int n) {// Stack<int> *s = new Stack<int> (n); / / for (int i = 0; i < n; i++) { // n e t [ i ] if (!s->isempty() ) { if (net[i] == net[s->top()] ) { // net[i] int x; s->delete(x);) else s->add(i); else s->add(i); //? if (s->isempty()) {

18 178 delete s; cout << "Switch box is routable" << endl; return true; delete s; cout << "Switch box is not routable" << endl; return false; n r r n 5-12 C a n, r r i c h a i n [ i ] j (i, j) (j, i) 5-12b o u t i o u t [ i ] = t r u e s t a c k o u t m c h a i n [ m ] m ( m, p ) p p c h a i n [ m ] m p d o ( 1 ) 5-12a ( n + r ) 5-12 b ( n ) ( 1 ) 5-12a n 2 r 5-12b 2 r ( r ) 5-12 ( n + r ) 5-12a ( ) void main(void) {// int n, r; // n r cout << "Enter number of elements" << endl; cin >> n; if (n < 2) {cerr << "Too few elements" << endl; exit(l); cout << "Enter number of relations" << endl; cin >> r; if (r < 1) {cerr << "Too few relations" << endl; exit(l); // n

19 Chain<int> *chain; try {chain = new Chain<int> [n+1]; catch (NoMem) {cerr << "Out of memory" << endl; exit(1); // r for (int i = 1; i <= r; i++) { cout << "Enter next relation/pair" << endl; int a, b; cin >> a >> b; c h a i n [ a ]. I n s e r t ( 0, b ) ; c h a i n [ b ]. I n s e r t ( 0, a ) ; 5-12b ( ) / / LinkedStack<int> stack; bool *out; try {out = new bool [n+1]; catch (NoMem) {cerr << "Out of memory" << endl; exit(l); for (int i = 1; i <= n; i++) out[i] = false; / / for (int i = 1; i <= n; i++) if (!out[i]) {// cout << "Next class is: " << i << ' ' ; out[i] = true; s t a c k. A d d ( i ) ; / / while (!stack.isempty()) { int *q, j; s t a c k. D e l e t e ( j ) ; // c h a i n [ j ] c ChainIterator<int> c; q = c.initialize(chain[j1); while (q){ if (!out[*q]) { cout << "q << ' '; out[*q] = true; s t a c k. A d d ( * q ) ; q = c.next(); cout << endl; cout << endl << "End of class list" << endl; 5-12 c h a i n o u t 5-12

20 m a z e n m ( 1, 1 ) (n,m) n m (i,j) rat in a maze

21 Please Enter Row 1 Press <Enter> when done

22 m a i n // // We l c o m e // I n p u t M a z e // F i n d P a t h // O u t p u t P a t h void main(void) { We l c o m e ( ) ; I n p u t M a z e ( ) ; if (FindPath()) OutputPath; else cout << "No path" << endl; C + + C

23 bool FindPath() { ; if ( ) return true; else return false; 5-14 FindPath 5-8 ( 1, 1 ) ( 1, 1 ) ( 2, 1 ) ( 2, 1 ( 1, 1 ) ( 2, 1 ) ( 3, 1 ) ( 2, 2 ) ( 3, 1 ) ( 2, 1 ) ( 3, 1 ( 4, 1 ) ( 3, 2 ) ( 4, 1 ( 3, 1 ) ( 4, 1 ) (5,1) (6,1) ( 7, 1 ) ( 8, 1 ) ( 8, 1 ) ( 1, 1 ) ( 8, 1 ) ( 8, 1 ( 7, 1 ) ( 7, 1 ) ( 7, 1 ( 6, 1 ) ( 3, 1 ) 3, i n t m a z e i n t 16 i, j m a z e [i, j] m n m a z e 0 m m m a z e

24 184 bool FindPath() {// ( 1, 1 ) ( m, m ) ; P o s i t i o n r o w c o l // P o s i t i o n Position here; here.row = 1; here.col = 1; Stack<Position> path(maxpathlength); M a x P a t h L e n g t h // while ( ) do { ; if ( ) { m m m 2 here p a t h ; 5-16 a // here = neighbor; MaxPathLength= m 2-1maze[here.row] [here.col] = 1; else { 2 m // if ( p a t h ) return false; a) b) a) b) 5-17 C + + return true; h e r e maze [1] [1] = 1; // p a t h here;

25 o ff s e t [ i ]. r o w o ff s e t [ i ]. c o l i r o w c o l ( 3, 4 ) 3 + o ff s e t [ 0 ]. r o w = o ff s e t [ 0 ]. c o l = C m a z e m ( ) p a t h int **maze, m; Stack<Position> *path; F i n d P a t h P o s i t i o n m a z e m I n p u t M a z e o ff s e t [ m o v e ]. r o w o ff s e t [ m o v ]. c o l bool FindPath {// ( 1, 1 ) ( m, m ) // true f a l s e // N o M e m path = new Stack<Position>(m * m - 1); / / Position off s e t [ 4 ] ; o ffset[0].row = 0; offset[0].col = 1; // o ffset[l].row = 1; offset[l].col = 0; // o ffset[2].row = 0; offset[2].col = -1; // o ffset[3].row = -1; offset[3].col = 0; // / / for (int i = 0; i <= m+l; i++) { maze [0] [i] = maze[m+l] [i] = 1; // maze [i] [0] = maze[i] [m+l] = 1; // Position here; here.row = 1; here.col = 1; maze [i] [i] = 1; // int option = 0; int LastOption = 3; / / while (here.row!= m here.col!= m) {// / /

26 186 int r, c; while (option <= LastOption) { r = here.row + off s e t [ o p t i o n ]. r o w ; c = here.col + off s e t [ o p t i o n ]. c o l ; if (maze[r][c] == 0) break; option++; // //? if (option <= LastOption) {// maze[r] [c] p a t h - > A d d ( h e r e ) ; here.row = r; here.col = c; / / maze [r] [c] = 1; option = 0; else {// if (path->isempty()) return false; Position next; p a t h - > D e l e t e ( n e x t ) ; if (next.row == here,row) option = 2 + next.col - here.col; else option = 3 + next.row - here.row; here = next; return true;// F i n d P a t h * p a t h w h i l e h e r e p a t h ( n e x t ) n e x t h e r e h e r e n e x t if ( next.row == here.row) Option= 2 + next.col - here.col; else option = 3 + next.row - here.row; ( 1 ) O (u n b l o c k e d) u n b l o c k e d O ( u n b l o c k e d ) =O ( m 2 )

27 ~n cout ShowState k k *12. 1) k 5-8 2) n+ ( ) 5-8 k i s i 1 i k 14. C + + C h e c k B o x C h e c k B o x (n) n 15. C h a i n L i n k e d S t a c k C h a i n :: D e l e t e L i n k e d S t a c k :: A d d c h a i n [ j ] d a t a x o u t [ x ] = 0 o u t n e w d e l e t e 1) C h a i n L i n k e d S t a c k d e l e t e o u t n e w 2) C + + 1) We l c o m e 2) I n p u t M a z e m a z 3) O u t p u t P a t h F i n d P a t h 1

28 F i n d P a t h 19. p a t h m p a t h p a t h S t a c k S t a c k 5-13 t o p p a t h 1 t o p 23. F i n d P a t h ) C.Hsu. General River Routing Algorithm. ACM/IEEE Design Automation Confere n c e, 578~583, ) R.Pinter. River-routing:Methodology and Analysis. T h i rd Caltech Conference on VLSI,

ebook39-6

ebook39-6 6 first-in-first-out, FIFO L i n e a r L i s t 3-1 C h a i n 3-8 5. 5. 3 F I F O L I F O 5. 5. 6 5. 5. 6.1 [ ] q u e n e ( r e a r ) ( f r o n t 6-1a A 6-1b 6-1b D C D 6-1c a) b) c) 6-1 F I F O L I F ADT

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 1.1 1.2 1.3 1.4 1.5 ++ 1.6 ++ 2 BNF 3 4 5 6 7 8 1.2 9 1.2 IF ELSE 10 1.2 11 1.2 12 1.3 Ada, Modula-2 Simula Smalltalk-80 C++, Objected Pascal(Delphi), Java, C#, VB.NET C++: C OOPL Java: C++ OOPL C# C++

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

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

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

FY.DOC

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

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

Chapter12 Derived Classes

Chapter12   Derived Classes 继 承 -- 派 生 类 复 习 1. 有 下 面 类 的 说 明, 有 错 误 的 语 句 是 : class X { A) const int a; B) X(); C) X(int val) {a=2 D) ~X(); 答 案 :C 不 正 确, 应 改 成 X(int val) : a(2) { 2. 下 列 静 态 数 据 成 员 的 特 性 中, 错 误 的 是 A) 说 明 静 态 数

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

untitled

untitled 1 7 7.1 7.2 7.3 7.4 7.5 2 7.1 VFT virtual 7.1 3 1 1. 2. public protected public 3. VFT 4. this const volatile 4 2 5. ( ) ( ) 7.1 6. no-static virtual 7.2 7. inline 7.3 5 3 8. this this 9. ( ) ( ) delete

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

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

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

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

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

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_cpp

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

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

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

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

ebook39-13

ebook39-13 1 3 13 ~ 17 13.1 optimizatio problem c o s t r a i t optimizatio fuctio feasible solutio optimal solutio 13-1 [ ] 1 i s i i a i i t i i= 1 x i x 1 i i s i x i x i =t 0 x i a i i=1 a i < t i= 1 406 / t

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

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

Strings

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

More information

Microsoft Word - 01.DOC

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

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

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

IO

IO 1 C/C++ C FILE* fscanf fgets fread fprintf fputs fwrite C++ ifstream ofstream >>

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

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 範 例 試 題 (C++) 試 題 編 號 :11900-920201-4 審 定 日 期 : 94 年 7 月 1 日 修 訂 日 期 : 96 年 2 月 1 日 97 年 1 月 30 日 ( 第 二 部 份 ) 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 應 檢 參 考 資 料 壹 試

More information

Microsoft Word - 11.doc

Microsoft Word - 11.doc 除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何

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

第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

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++语言 - 分支结构

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

第5章修改稿

第5章修改稿 (Programming Language), ok,, if then else,(), ()() 5.0 5.0.0, (Variable Declaration) var x : T x, T, x,,,, var x : T P = x, x' : T P P, () var x:t P,,, yz, var x : int x:=2. y := x+z = x, x' : int x' =2

More information

C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1

C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1 C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1 1 CARDGAME 1 CardGame 题目描述 桌上有一叠牌, 从第一张牌 ( 即位于顶面的牌 ) 开始从上往下依次编号为 1~n 当至少还剩两张牌时进行以下操作 : 把第一张牌扔掉, 然后把新的第一张放到整叠牌的最后 请模拟这个过程, 依次输出每次扔掉的牌以及最后剩下的牌的编号 输入 输入正整数 n(n

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

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

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

Microsoft Word - 970617cppFinalSolution.doc

Microsoft Word - 970617cppFinalSolution.doc 國 立 台 灣 海 洋 大 學 資 訊 工 程 系 C++ 程 式 設 計 期 末 考 參 考 答 案 姓 名 : 系 級 : 學 號 : 97/06/17 考 試 時 間 :10:00 12:10 試 題 敘 述 蠻 多 的, 看 清 楚 題 目 問 什 麼, 針 對 重 點 回 答 是 很 重 要 的 ; 不 確 定 的 請 一 定 要 當 場 提 出 來, 不 要 白 花 力 氣 在 誤 會

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

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

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

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

untitled

untitled (encapsulation) 例 類 說 類 料 來 料 information hiding 念 (inheritance) 來說 類 類 類 類 類 類 行 利 來 (polymorphism) 不 類 數 不 1 2 3 4 類 類 不 類 不 類 5 6 7 // virtual 不見了 #include #include using namespace

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

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

プログラムの設計と実現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

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

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

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

Microsoft Word - ....9.\.U.e.~.g...X...doc

Microsoft Word - ....9.\.U.e.~.g...X...doc 附 錄 九 餐 廳 委 外 經 營 合 約 德 育 醫 護 管 理 專 科 學 校 ( 以 下 簡 稱 甲 方 ) 委 託 公 司 ( 以 下 簡 稱 乙 方 ), 經 營 甲 方 經 國 樓 地 下 室 上 廳 供 應 社, 供 應 本 校 師 生 餐 食, 經 雙 方 協 議, 茲 訂 定 左 列 條 款 以 資 共 同 遵 守 履 行 第 一 條 本 ( 臨 時 ) 合 約 有 效 期 限 自

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 - 把时间当作朋友(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

chp6.ppt

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

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

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

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

K7VT2_QIG_v3

K7VT2_QIG_v3 ............ 1 2 3 4 5 [R] : Enter Raid setup utility 6 Press[A]keytocreateRAID RAID Type: JBOD RAID 0 RAID 1: 2 7 RAID 0 Auto Create Manual Create: 2 RAID 0 Block Size: 16K 32K

More information

Microsoft PowerPoint - string_kruse [兼容模式]

Microsoft PowerPoint - string_kruse [兼容模式] Strings Strings in C not encapsulated Every C-string has type char *. Hence, a C-string references an address in memory, the first of a contiguous set of bytes that store the characters making up the string.

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

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

新 社 會 政 策 雙 月 刊 內 地 女 性 在 香 港 所 生 的 活 產 嬰 兒 數 目 年 份 活 產 嬰 兒 數 目 其 配 偶 為 香 港 永 久 性 居 民 其 配 偶 為 非 香 港 永 久 性 居 民 其 他 小 計 2000 2001 54.134 48,219 L 464 70

新 社 會 政 策 雙 月 刊 內 地 女 性 在 香 港 所 生 的 活 產 嬰 兒 數 目 年 份 活 產 嬰 兒 數 目 其 配 偶 為 香 港 永 久 性 居 民 其 配 偶 為 非 香 港 永 久 性 居 民 其 他 小 計 2000 2001 54.134 48,219 L 464 70 內 地 孕 婦 到 香 港 分 婉 的 得 失 利 弊 劉 慧 卿 香 港 民 主 黨 立 法 會 議 員 內 地 孕 婦 來 港 分 挽 問 題 沸 沸 揚 揚 每 年 7 月 1 日, 特 區 政 府 會 舉 辦 活 動 慶 祝 回 歸, 而 民 主 派 政 黨 和 民 間 團 體 則 組 織 七 一 遊 行 J ' 表 達 對 政 府 的 不 滿 和 訴 求 今 年 七 一 遊 行, 有 2

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

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

概述

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

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

Fuzzy Highlight.ppt

Fuzzy Highlight.ppt Fuzzy Highlight high light Openfind O(kn) n k O(nm) m Knuth O(n) m Knuth Unix grep regular expression exact match Yahoo agrep fuzzy match Gais agrep Openfind gais exact match fuzzy match fuzzy match O(kn)

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

財金資訊-80期.indd

財金資訊-80期.indd IPv6 / LINE YouTube TCP/IP TCP (Transmission Control Protocol) IP (Internet Protocol) (node) (address) IPv4 168.95.1.1 IPv4 1981 RFC 791 --IP IPv4 32 2 32 42 IP (Internet Service Provider ISP) IP IP IPv4

More information

第2章 递归与分治策略

第2章  递归与分治策略 : 1. 2. 3. Strassen 4. 5. 6. 7. 8. 9... 2 T(n) = n T(n/2) T(n/2) T(n/2) T(n/2) 3 T(n) = n n/2 n/2 n/2 n/2 T(n/4)T(n/4)T(n/4)T(n/4) T(n/4)T(n/4)T(n/4)T(n/4) T(n/4)T(n/4)T(n/4)T(n/4) T(n/4)T(n/4)T(n/4)T(n/4

More information

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2 PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native

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

Microsoft PowerPoint - os_4.ppt

Microsoft PowerPoint - os_4.ppt 行 程 資 科 系 林 偉 川 行 程 概 念 行 程 與 程 式 主 要 的 不 同 點 : 程 式 是 被 放 在 外 部 的 儲 存 裝 置 如 磁 碟 上, 而 行 程 則 被 放 在 記 憶 體 中 程 式 在 儲 存 裝 置 中 是 靜 態 的, 而 行 程 在 記 憶 體 中 是 動 態 的, 它 會 隨 著 一 些 事 件 的 發 生 而 產 生 相 對 的 改 變 行 程, 就 是

More information

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B 25 9 2008 9 M ICROEL ECTRON ICS & COMPU TER Vol. 25 No. 9 September 2008 J ava 1,2, 1,2, 1,2 (1, 330022 ; 2, 330022) :,. Apla - Java,,.. : PAR ;Apla - Java ; ;CMP ; : TP311 : A : 1000-7180 (2008) 09-0018

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

Open topic Bellman-Ford算法与负环

Open topic   Bellman-Ford算法与负环 Open topic Bellman-Ford 2018 11 5 171860508@smail.nju.edu.cn 1/15 Contents 1. G s BF 2. BF 3. BF 2/15 BF G Bellman-Ford false 3/15 BF G Bellman-Ford false G c = v 0, v 1,..., v k (v 0 = v k ) k w(v i 1,

More information

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

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

More information

untitled

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

More information

2015年全国射箭冠军赛.xls

2015年全国射箭冠军赛.xls 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 10's X's 70(1-1) 70(1-2)

More information

2015年全国室外射箭锦标赛.xls

2015年全国室外射箭锦标赛.xls 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 70(2-1) 70(2-2) 10's X's 70(1-1) 70(1-2) 10's X's 70(1-1) 70(1-2)

More information

2015年全国射箭重点学校锦标赛.xls

2015年全国射箭重点学校锦标赛.xls 60(1) 60(2) 50 30 10's X's 60(1) 60(2) 50 30 10's X's 1 2 3 4 5 6 10's X's 40A 41A 40C 42A 43C 38C 46B 40B 46C 45B 41C 37C 43A 37B 39C 41B 1 2 3 4 5 6 10's X's 44B 44A 42B 45A 38B 43B 38A 39B 37A 42C 46A

More information

2017年全国射箭重点体校锦标赛.xls

2017年全国射箭重点体校锦标赛.xls 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2 50 30 10's X's 70 170 2

More information

C++ 程序设计 OJ4 - 参考答案 MASTER 2017 年 5 月 21 日 1

C++ 程序设计 OJ4 - 参考答案 MASTER 2017 年 5 月 21 日 1 C++ 程序设计 OJ4 - 参考答案 MASTER 2017 年 5 月 21 日 1 1 SWAP 1 Swap 题目描述 用函数模板的方式实现对不同数据类型的数组中的数据进行输入 从小到大排序和输出 使用如下主函数测试你的模板设计一个函数模板 Swap, 实现任意数据类型的两个数据的交换, 分别用 int 型 double 型和 char 型的数据进行测试 main 函数如下 : int main()

More information

提问袁小兵:

提问袁小兵: C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.

More information

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

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2009 年 下 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答

More information

e bug 0 x=0 y=5/x 0 Return 4 2

e bug 0 x=0 y=5/x 0 Return 4 2 e 1 4 1 4 4.1 4.2 4.3 4.4 4.5 e 2 4.1 bug 0 x=0 y=5/x 0 Return 4 2 e 3 4 3 e 4 (true) (false) 4 4 e 5 4 5 4.2 1 G= V E V={n1,n2,,n m } E={e1,e2,,e p } e k ={n i,n j }, n i,n j V e 6 4.2 4 6 1 e 3 n 1 e

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

《大话设计模式》第一章

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

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

<5B BECBB0EDB8AEC1F25D312D34B0AD5FC3E2BCAEBCF6BEF7C0DAB7E F31702E504446>

<5B BECBB0EDB8AEC1F25D312D34B0AD5FC3E2BCAEBCF6BEF7C0DAB7E F31702E504446> : 2 = 3 4? 0 an ordered set of unambiguous, executable steps that produces a result and terminates in a finite time (computational theory) ( ) 5 6 (C-) int min, max; float degree, b; char ch, token; /,,,

More information

(Microsoft Word - Motion Program \270\305\264\272\276\363 \307\245\301\366 \271\327 \270\361\302\367.doc)

(Microsoft Word - Motion Program \270\305\264\272\276\363 \307\245\301\366 \271\327 \270\361\302\367.doc) : TBFAT-G5MP-MN004-11 1 GX Series PLC Program Manual 2 GX Series PLC Program Manual Contents Contents...3 1... 1-1 1.1... 1-2 1.2... 1-3 1.2.1... 1-3 1.2.2... 1-4 1.2.3... 1-4 1.2.4... 1-6 1.3... 1-7 1.3.1...

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

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

(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

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

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

More information