Документ взят из кэша поисковой машины. Адрес оригинального документа : http://ani.cmc.msu.ru/files/geo-2009-prac-05.pdf
Дата изменения: Sat Oct 3 21:56:29 2009
Дата индексирования: Mon Oct 1 19:38:15 2012
Кодировка:
, . .
. . http://ani.cmc.msu.ru/geol

5 -- ()

2009/2010 . .

. . ( )

5 -- ()

2009 ,

1 / 11



1

Dev-C++
. . ( ) 5 -- () 2009 , 2 / 11

2

3


Dev-C++ --

. . ( )

5 -- ()

2009 ,

3 / 11


Dev-C++ --

. . ( )

5 -- ()

2009 ,

4 / 11



{

int

Min (

int

a,

int

b)

}

i f (a < b) return else return

a; b; a) { a;

} {

d o u b l e Cube ( d o u b l e return a * a * int
main ( ) c o u t << c o u t << system ( " 0

}

return

M i n ( 1 , 2 ) << e n d l ; C u b e ( 3 . 0 ) << e n d l ; pause " ) ; ;

. . ( )

5 -- ()

2009 ,

5 / 11



bool
{

} {

x 1 = (- b - s q r t ( D ) ) / ( 2 * a ) ; x 2 = (- b + s q r t ( D ) ) / ( 2 * a ) ; ;

Root2 ( double a , double b , double d o u b l e &x 1 , d o u b l e &x 2 ) double D = b * b - 4 * a * c ; i f (D < 0 . 0 ) r e t u r n f a l s e ;

c,

return true

int

main ( )

}

d o u b l e x1 , i f ( Root2 ( 1 c o u t << else c o u t << return 0;

x2 ; . 0 , 5 . 0 , 6 . 0 , x1 , x 2 ) ) " x 1 : " << x 1 << e n d l << " x 2 : " << x 2 << e n d " No r o o t s \ n " ;

. . ( )

5 -- ()

2009 ,

6 / 11




t y p e d e f i n t Fun_t ( i n t x ) ; v o i d P r i n t ( Fun_t f ) { f o r ( i n t i = 0 ; i <= 4 ; ++ i )
}

c o u t << " i : " << i << " f : " << f ( i ) << e n d l ;

{

int int int

Square ( Cube ( main ( )

int int i

i) { ){

return return i

i*i ; } *i*i ; }

}

P r i n t ( Square ) ; P r i n t ( Cube ) ; system ( " pause " ) ; 0;

return

. . ( )

5 -- ()

2009 ,

7 / 11



#i n c l u d e < i o s t r e u s i n g namespace int glb_i = 42; void Inc () {
} ++g l b _ i ; am> std ;

void
}

-- g l b _ i ;

Dec ( ) {

int

main ( ) { c o u t << " I n i t i a l v a l : " << g l b _ i << e n d l ; / / 4 2 Inc ( ) ; c o u t << " A f t e r I n c ( ) : " << g l b _ i << e n d l ; / / 4 3 Dec ( ) ; c o u t << " A f t e r D e c ( ) : " << g l b _ i << e n d l ; / / 4 2

}

return

0;

. . ( )

5 -- ()

2009 ,

8 / 11



#i n c l u d e < i o s t r e u s i n g namespace void I n c ( ) { static int
} am> std ; stc_i = 42; c o u t << " b e f o r e : " << s t c _ i ; ++s t c _ i ; c o u t << " a f t e r : " << s t c _ i << e n d l ; main ( ) { c o u t << " 1 s t c a l l - " ; Inc ( ) ; c o u t << " 2 n d c a l l - " ; Inc ( ) ; }

int

return

0;

. . ( )

5 -- ()

2009 ,

9 / 11



1. « » bool Election(bool x, bool y, bool z), (true false), x , y z . 2. , ax + b = c . a, b c . 1, , -- 0, , -- -1, . 3. fh (x ) f (x ) x fh (x ) = 21 [f (x + h) - f (x - h)]. h Deriv(), , x h > 0. 0,1 f (x ) = x 2 [A, B ] h = 0,01. .
. . ( ) 5 -- () 2009 , 10 / 11


()
1. (x1, y1) , . bool Inside(), true , ( .. ) , false. , ( ). 2. double Min(double a, double b, double c, double d), 3. bool Xor(bool x, bool y), « » x y . Xor() true, x y , true. main() x y , Xor(x, y) .
. . ( ) 5 -- () 2009 , 11 / 11