Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://ani.cmc.msu.ru/files/geo-2010-prac-01.pdf
Äàòà èçìåíåíèÿ: Sat Sep 4 00:04:23 2010
Äàòà èíäåêñèðîâàíèÿ: Mon Oct 1 19:38:35 2012
Êîäèðîâêà:
C++, Dev-C++,
,

. .
. . http://ani.cmc.msu.ru/geol

2010/2011

. . ( )

. . .

­2010

1 / 36



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

C++ -
. . . ­2010 2 / 36

. . ( )



, ,

«, » . . -- -- , , , :
.-. (. ) . () ( ) pozdneev@cmc.msu.ru
. . ( ) . . . ­2010 3 / 36



,

:
( ) -- 16 ( )

:
,

:
.

:

. . ( ) . . . ­2010 4 / 36





C++ Maple

. . ( )

. . .

­2010

5 / 36




. . ++ .: , 2000, 2004, 2008

http://www.finstat.ru/podbelsky- cpp.htm

. . ( )

. . .

­2010

6 / 36



C++ -- Dev-C++ Windows Maple -- 10 :
Microsoft Visual C++ (Windows, ) Eclipse (Windows/Linux, ) GCC (Windows/Linux, ) Intel C (Windows/Linux, Linux )

:
Maxima Axiom

- Windows:
Mozilla Firefox -- Opera -- «»
. . ( ) . . . ­2010 7 / 36




. . ( )

. . .

­2010

8 / 36


C++
Dev-C++

. . ( )

. . .

­2010

9 / 36


C++


-- C++ -- main Main MAIN
1 2 3 4 5 6 7 8 9

# include < iostream > using namespace std ; int m { c s r } ain () out << " Hello , World !" << endl ; ystem (" pause "); eturn 0;

. . ( )

. . .

­2010

10 / 36


C++
hello.cpp

. . ( )

. . .

­2010

11 / 36


C++


. . ( )

. . .

­2010

12 / 36


C++


, «Hello, World!» «Enter»,

. . ( )

. . .

­2010

13 / 36


C++


, Dev-C++

. . ( )

. . .

­2010

14 / 36


C++

1 2 3 4 5 6 7 8 9

# include < iostream > using namespace std ; int m { c s r } ain () out << " Hello , World !" << endl ; ystem (" pause "); // wait for user to press any key eturn 0;

1: (streams) / (Input/Output) 2: C++ 3: // ; 4: main() -- C++ ; int ,
. . ( ) . . . ­2010 15 / 36


C++
()
1 2 3 4 5 6 7 8 9

# include < iostream > using namespace std ; int m { c s r } ain () out << " Hello , World !" << endl ; ystem (" pause "); // wait for user to press any key eturn 0;

5, 9: 6: cout -- , 6: , , << 6: endl
. . ( ) . . . ­2010 16 / 36


C++
()

1 2 3 4 5 6 7 8 9

# include < iostream > using namespace std ; int m { c s r } ain () out << " Hello , World !" << endl ; ystem (" pause "); // wait for user to press any key eturn 0;

7: system("pause") 8: ; «0»

. . ( )

. . .

­2010

17 / 36


C++


, , :
1 2 3

# include < iostream > using n a m e s p a c e std ; int main (){ cout < < " Hello , W o r l d !" < < e n d l ; s y s t e m (" p a u s e ") ; r e t u r n 0 ; }



. . ( )

. . .

­2010

18 / 36


C++
()

, «//»,
, !

C++ «;» -- , «#include » : « iostream» , , «.h» («#include ») --

. . ( )

. . .

­2010

19 / 36


C++


, : «I love C++» cout? cout?

. . ( )

. . .

­2010

20 / 36


-
-- , -, - -- , :

. . ( )

. . .

­2010

21 / 36


- «Hello, World!»

. . ( )

. . .

­2010

22 / 36


- «Hello, World!» ()

. . ( )

. . .

­2010

23 / 36




:


. . ( )

. . .

­2010

24 / 36



a + x = b

: a + x = b , a b :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #i n c l u d e < i o s t r e a m > u s i n g namespace s t d ; i n t main ( ) { double a , b ; c o u t << " I n p u t a : c i n >> a ; c o u t << " I n p u t b : c i n >> b ; ";

";

double x = b - a ; c o u t << " R o o t o f e q u a t i o n a+x=b i s " << x << e n d l ; system (" pause " ) ; return 0; }

. . ( )

. . .

­2010

25 / 36



a + x = b ()

- C++ C++ ,
( , )

. . ( )

. . .

­2010

26 / 36




1 2 3 4 5 6

int main () { double a , b; cout << " Input a : "; cin >> a ; double x = b - a; cout << " Root of e q u a t i o n a + x = b is " << x << endl ;

1 2

4: a b , 9: , , a 14: x 15: ,
. . ( ) . . . ­2010 27 / 36





a + b a b ; a b , ?

. . ( )

. . .

­2010

28 / 36


C++
-- int
, 4 -2 147 483 648 2 147 483 647

-- double
, 8 1,797693 · 10308 -- 2,225074 · 10
-308

-- char
, 1 , ,

, ,

. . ( )

. . .

­2010

29 / 36



«a­z, A­Z» «_» «0­9» «_» (int, return, . . . ) : : a, b, x1, y_42, day_of_week, num_of_students, route_66 : 3rd_law, double : _temp_var, new_var_
. . ( ) . . . ­2010 30 / 36



-- , , , «=» , «=» , :
+ -- - -- * -- / -- (6/4 1, 6.0/4 1.25, 6/4.0 1.25) % -- (6 % 4 2)

. . ( )

. . .

­2010

31 / 36



C++

-- , , , , «//»,
1 2 3 4 5

int d r // }

main ouble eturn you m

() p 0 ay

{ i, ;/ co

/ e / m

/ th ; // exi ment

eb th tp em

e e o p

gi p in ty

nnin i an t of lin

g of d th the es a

th ee fu sw

e main function numbers nction ell

. . ( )

. . .

­2010

32 / 36



C

: /**/
1 2 3 4 5 6 7 8 9 0 1 2 3 4

/ t w * i

* h h / n

Some long comment , at could explain , at this f u n c t i o n is doing t / / / d c main () { such c o m m e n t s are useful */ to d i s a b l e some parts of the code */ uble a , b , c; ut << a << ' ' << b << ' ' << c << endl ;

* * * o o

*/ return 0; }
. . ( ) . . . ­2010 33 / 36



, . . , :
1 2 3 4 5 6 7 8 9

i i i d d d d d i

n n n o o o o o n

t t t u u u u u t

b b b b b

a b c l l l l l i

e e e e e

= 13/ = 13% = 13. d= e= f= g= h= = 13.

5 5 0 1 1 1 1 1 0

; ; / 3 3 3 3 3 /

5 / % . / . 5

; 5 5 0 5 0

; ; /5 + /5 +

; 2/5; + 2.0/5; 2.0/5;

. . ( )

. . .

­2010

34 / 36



1. a b. , (.. a b ) 2. x . x 4 . ? 3. x . x 7 . 4. x . x .
13



5. . . 6. . ( ).
. . ( ) . . . ­2010 35 / 36



1. x . x 6 . 2. x . x 8 . 3. x . x 21 . 4. . . 5. . . : 1. a b. , , - 2. : h, m, s. ( ) «h , m , s » .
. . ( ) . . . ­2010 36 / 36