You are on page 1of 18

.., ..

-

,
010400
010300

004.43(075.8)
32.973-018.173

611
:
- , .. ;
- , ..


..
611 : .
. . / .., ..
. .: , 2012. 304.
(. ).

ISBN 978-5-7695-7973-8

010400
( ).
: ,
-, . ,
.
: ++, #, Java.
.
.

004.43(075.8)
32.973-018.173

,

... ..
: ... ..
. 101115871. 28.10.2011. 60 90/16. .
1. . . . . 19,0. 1000 .
. www.academia-moscow.ru
125252, , . , . 15, . 1, . 26.
: 129085, , - , 101, . 1, / 48.
./: (495) 648-0507, 616-00-29.
- RU. AE51. H 14964 21.12.2010.
.
, 170024, . , - , 5.
: (4822) 44-52-03, 44-50-34. /: (4822) 44-42-15.
Home page www.tverpk.ru (E-mail) sales@tverpk.ru

-
,

ISBN 978-5-7695-7973-8

.., .., 2012


- , 2012
. , 2012

:
, .
.
: ,
,
++. ? ,
, .
, , ,
, .

,
. ...
, , .

.

, (,
, ).

. ++, Java C#. ,
-, , -,
, -, ,

.

,
,
.
, ,
- (, ). -



. ,
,
, .

.

1.1.

[18]: -.
( ) , ,

(XVIII .) . (XIX .), .
:
( ). , ,
.
:
[6].
,
, .
, SQL [12].
().
, (, ),
.

HTML [19]. HTML
.
- (-). ,

.
, , .
, .. (). ,
(
), . SQL, HTML
, (, Java ++)
, .
, ,
, : , .
.

1.2.

, ,
. , (
) :
.
( )
- . (
, ),
(,
), ,
(, , , ..), -
(, ).
-
( , - ), ( ,
).
( ),
(.. ) (, , )
.
-
, .

(, , ).
, ,
.
, .. ,
, , .
, .
( , , ),
( ),
.
( ) (
, ,
).
- .
,
, .

.

, . ,
, .

, , .

.
,
.
. ,
, .
. ( )
.

(.. , ..). , , ,

. .


( )
- ,
. .

, .
:
();
();
- ().
.
, .
.
, .
.
.
( ), (.. ).
-
.
: (),
(, , , ,
, ..), , ,
. (
), ,
. ,
, ,
- .
:
;
- ;
, (, );
-
( -
).

.
, ,
, .

() . ,
( VAR X:Integer,
int x), (A * B ),
( , .).

. (.. )
( ).
- .
.
.
:
;
;
-.

,
V:=E

V ; E .
(, X * (Y+1)/2).

E ( ) ,
V. , - (
).
.
(, , ..)
.
- .
. 5
.
, ,
.

.
(, ),
- (++, Java, C#, Delphi, Objective
C ).
.
,
, ..,
.
( )
:
;
;
.
,
,
, ( ).
, .
?
, , .
. ,
, . ,

. , ,
1 024 .
.
, , :
, ,
, .
(
).
#include <stdio.h>
#define MAX_ELEMENTS 1024
char Input[MAX_ELEMENTS];
int main()
{
int current, count = 0;

10

while ((current = getchar()) != EOF)


if (count == MAX_ELEMENTS) {

fprintf(stderr, " ");

return 1;
} else

Input[count++] = current;
for (int i = count-1; i >= 0; i--)
putchar(Input[i]);
return 0;
}
-,
MAX_ELEMENTS (
) Input (,
). main,
. current ( )
count ( ).
while Input . getchar
.
, = .
,
, ,
. ,
( ),
. . ,
.

(current = getchar())!=EOF
getchar current, (..
) EOF (, EOF
, ,
).
, .
,
. ++
count++ ,
1 count,
count .

11

Input[count++] = current;
current ,
count 1.
-- i-- i
.
,
(stderr) fprintf " ".
return 1 (
main).
for , .
0, count-1,
0, i
count-1 0.
main.


.
.
. ,
. .
:
X
Y, .. , Y
X;

Derived Base,
, , (
Derived). , Derived
Base, ;
W ( )
Ref.
.
. ,
, .
.

. - .

12


,
.
- ()
.
, ( )
,
.
, -
. C#.
(
C# , ). , , . #
,
(, ..), (
).
C#:
using System;
class Program
{

static void Main(string[] args)

{

string s = Console.In.ReadToEnd();

char[] seq = s.ToCharArray();

Array.Reverse(seq);

Console.Write(seq);

}
}
System, Console
- Array .
Program,
Main. ,
:
.
s
. Console
In TextReader, .
. ,

13

.

, .
ToCharArray
(char [] seq),
. Reverse Array (..
). .
. -,
, . -,

. ,

, .
,
. ,

.
. .
. ,
.

. ,
C# ,
.
: s , seq . , ,
,
,
C#. . , C#
.
, , , , :
using System;
class Program
{

static void Main(string[] args)

{
string s = Console.In.ReadToEnd();
for (int i = s.Length-1; i>=0;i--)

Console.Write(s[i]);

}
}

14

, , ++,

.


. . ( ) .
,
.
.

.
.
c ,

. , ,
.
[34]
,
.
.
, .

(- --)
,
(+ 2 3)

(defun - (--) )
,
(defun plus1(x) (+ x 1))
:
(read)
,
-.

15

. 11.2. , .
- . (), .
, , . , .
nil, .
(). , . ,
.
, - ,
. , read ( ), - ( ).

. (). . ,
, , .
.
read ,
. , reverse.
(print ):
(print (reverse (read)))
, reverse:
(defun rev(x)

(if (null x)

nil

(append (rev (cdr x))(cons (car x) nil))

)
)

. , , . ,
, (
(car x) x) ,
( (cdr x)
x). ,
:
((rev (cdr x))),
x(car x).
,

16

(cons a b).
a b. , (cons
(car x) nil) .
append ,
(null x) x .
if ((null x)), ,
(nil), ((append (rev (cdr x))(cons (car x)
nil))).
, . ( ).
. . -,
reverse. -, ( )
,
.
, . , ,
,
.

1.3.


( . [18]): ,
.
, , , , .
.
() . integer
,
, .

.
,
, ..
.
, (),
( break continue ).

17


. , ,
, ,
.
,
(), .

, .
.
.
,
, .
. , .
,
,
. . ,
, ,
.
,
.