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

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

2009/2010 . .

. . ( )

. . .

2009 .

1 / 36



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

C++ -
. . . 2009 . 2 / 36

. . ( )



, ,

«, » . . -- -- , , , :

.-. (. ) . () ( ) pozdneev@cmc.msu.ru
. . . 2009 .

. . ( )

3 / 36



,

:

:

( ) -- 16 ( ) , .

:

:


. . . 2009 . 4 / 36

. . ( )






C++ Maple

. . ( )

. . .

2009 .

5 / 36




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

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

. . ( )

. . .

2009 .

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

7 / 36




. . ( )

. . .

2009 .

8 / 36


C++
Dev-C++

. . ( )

. . .

2009 .

9 / 36


C++


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

#i n c l u d e < i o s t r e a u s i n g namespace i n t main ( ) { c o u t << " H e l system ( " paus return 0; }

m> std ; l o , World ! " << e n d l ; e" );

. . ( )

. . .

2009 .

10 / 36


C++
hello.cpp

. . ( )

. . .

2009 .

11 / 36


C++


. . ( )

. . .

2009 .

12 / 36


C++


, «Hello, World!» «Enter»,

. . ( )

. . .

2009 .

13 / 36


C++


, Dev-C++

. . ( )

. . .

2009 .

14 / 36


C++


1 2 3 4 5 6 7 8 9

#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 ( ) / / { c o u t << " H e l l o , system ( " pause " ) ; return 0; }

/ / / // World ! " << e n d l ; / / / /

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


C++
()

1 2 3 4 5 6 7 8 9

#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 ( ) / / { c o u t << " H e l l o , system ( " pause " ) ; return 0; }

/ / / // World ! " << e n d l ; / / / /

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


C++
()

1 2 3 4 5 6 7 8 9

#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 ( ) / / { c o u t << " H e l l o , system ( " pause " ) ; return 0; }

/ / / // World ! " << e n d l ; / / / /

7: system("pause") 8: ; «0»
. . ( ) . . . 2009 . 17 / 36


C++


, , :
1 2 3

#i n c l u d e < i o s t r e a m > u s i n g n a m e s p a c e s t d ; i n t main ( ) { c o u t << " H e l l o , World ! "<

. . ( )

. . .

2009 .

18 / 36


C++
()

, «//»,

, !

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

. . ( )

. . .

2009 .

19 / 36


C++


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

. . ( )

. . .

2009 .

20 / 36


-

-- , -, - -- , :

. . ( )

. . .

2009 .

21 / 36


- «Hello, World!»

. . ( )

. . .

2009 .

22 / 36


- «Hello, World!» ()

. . ( )

. . .

2009 .

23 / 36




:



. . ( )

. . .

2009 .

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;

}

. . ( )

. . .

2009 .

25 / 36





a+x =b

()

- C++ C++ ,

( , )
. . . 2009 . 26 / 36

. . ( )





4 5 6 7 8 9 4 5

i n t main ( ) { double a , b ; c o u t << " I n p u t a : " ; c i n >> a ; 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 ;
4: a b, 9: , , a 14: x 15: ,
. . ( ) . . . 2009 . 27 / 36





a + b a b; a b , ?

. . ( )

. . .

2009 .

28 / 36


C++

-- int

-- double

, 4 -2 147 483 648
308

2 147 483 647

-- char

, 8 1,797693 · 10 --

2,225074 · 10-308

, 1 , ,

, ,

. . ( )

. . .

2009 .

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_
. . ( ) . . . 2009 . 30 / 36




-- , , , «=» , «=» , :

+ - * / % (6

-- -- -- -- (6/4 1, 6.0/4 1.25, 6/4.0 -- % 4 2)
. . .

1.25

)

. . ( )

2009 .

31 / 36



C++

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

i n t main double return / / }

() p 0

{/ i, e ; //

/ ; //















. . ( )

. . .

2009 .

32 / 36



C

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

/ * , , */ i n t main ( ) { / * * / / * " " * / /* double a , b , c ; c o u t << a << ' ' << b << ' ' << c << e n d l ; / * return 0; }
. . ( ) . . . 2009 . 33 / 36




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

in in in do do do do do in

t t t u u u u u t

a b c bl bl bl bl bl i

e e e e e

= = = d e f g h =

13/5; 13%5; 13.0/5; = 13/5; = 13%5; = 13.0/5 = 13/5 + = 13.0/5 13.0/5 +

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

;

. . ( )

. . .

2009 .

34 / 36




1

a b. , (.. a b ) x . x 4 . ? x . x 7 . x . x .
13

2

3

4



5 6

. . . ( ).
. . . 2009 . 35 / 36

. . ( )




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

36 / 36