Вы находитесь на странице: 1из 64

1

1. . . . . . . . . . . . . . . . . . . . 3
2. Microsoft Visual Studio 2013. . . . . . . . . . 9
3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6. . . . . . . . . . . . . . . . . . . . . . . . 41
7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

1.

.
, !
? , -
. ,
: !
. ,
Internet, ,
, . ,
:
? :
, , , . ,
,
, . ! , ,
,
,
. ,
. ,
, ,
. ,
.
,
!!!
3

,
, ,
, .

XIX
20 707 .
XIX .
,
520- ,
.
1804
- . ,
.

,
, .
1890
- , .

.

International Business Machines (IBM).
1936 ,
(
4

),
,
.
1941
Z3,
.
.
1945 ()
.

.
1 1945
,

.
21 1948 () -1

.
1949
.
, ,
.

(assembly system) .
5

1949 ()
.
1951 Remington Rand
.
(compiler ).
1957 20- - IBM
- -
(FORmula TRANslation ).
30-
. .
1963 .
,
. .
Dartmouth BASIC.
C 19581968 ,
(algorithmic language).
,
,
.
,

,
, ,
.
6

1970 , ,

. ,
, .
1972 31- Bell Labs .

. .
,
.
,

,

.

(NSI)
1983 , ANSI .
80- ll Lbratory

,
. 1983
++.
23 1995 Sun Microsystems Oak.

. Oak
7

Java
.
2000-2001
C# (-),
.NET.
Microsoft Research (
Microsoft) ,
, ,
. # 2.0
2005 . ,
, # ,
++.
,
, ++ , ++ .

. ,
, ++.
,
, .

.
IT-
.
,
.

2. Microsoft
Visual Studio 2013
Microsoft Visual Studio
Microsoft, :
.
Visual Studio
(IDE Integrated development environment),
.
Visual Studio
,
. Visual Studio .
Visual Studio 1997 .
Visual Studio 97.
Microsoft Visual
Studio 2013.
. Visual
Studio (edition) Visual Studio.
Visual Studio Visual Studio,
.
Visual Studio 2013 : Ultimate,
Premium, Professional, Test Professional, Express Editions.
Ultimate Visual Studio.
.
Express Editions. Visual Studio (), . , 9

-,
.. Express Editions
,
. ,
Visual Studio . ,
. !

,

.
.
Visual Studio
Microsoft Visual Studio 2013 Ultimate Microsoft Visual
Studio Express 2013 Windows Desktop. Ultimate.
,
Ultimate, DVD
DVD- (
ISO-
DVD ,
,
Daemon Tools Lite) vs_ultimate.
exe,
:

Visual Studio,
10

Visual Studio.
,
Join the Visual Studio Experience
Improvement Program . , Visual Studio I agree
to the License Terms and Privacy Policy.
,

.
Next. .
,
.
.
.
INSTALL.

11

.
, ,
.
.

LAUNCH.
Visual Studio ,

Windows ( , . .)

12

Visual Studio,

.
Microsoft
Live ID.

.
Not now,
may be later.

13


(MSDN) Microsoft.
,
Help->Add and Remove Help
Content Ctrl+Alt+F1.

14

.
Add.
:)
Update .

Microsoft
Visual Studio Express 2013 Windows Desktop.
Ultimate.
, Express,
DVD DVD- ( ISO-
DVD , , Daemon
Tools Lite) wdexpress_full.exe,
:

15

Visual Studio, Visual Studio.



,
Join the Visual Studio Experience Improvement Program.
, Visual Studio
I agree to the License Terms and Privacy Policy.
, .

INSTALL.
Visual Studio. . , ,
.
.
16


LAUNCH.
Visual Studio ,

Windows ( , . .). Ultimate LIVE
ID ( ),
.
,
,
.
.
, .

17

3.
, :
-, .
. ,
- .
, ?:)
,
-, ,
. , , ,
, . .
.
.
, .
: -
.
, .
, C
. ,
,
. , , .
, ,
Hello, world!,
:
18

_Y+._5l+f-+ +f+ -+f_f+m+++-;-wG=x+MZ __ + @ - -!+ L-!T


u ._5l+f-&ZQW&+& &Jf&B_
+f;sl+< _t=+_Gu_OWf+-f3+-
_>] +Mm _+ 9+tp+) fd __+RP
+ 9+tp+) + +
t--_+f;s l+ +u"++MD t +- 3+
D$$._4++
._ d4 - ubS d4 +__ --ff-+
-+A+@+-[Xf +tRPRVh+_S Z+f-ff-d+ RfRfh 4
+ZSC-+-++_e f+f_ffd t3++d4 d4 f_f _t d4 - uSS d4 +__ --ff-+-+A+@+-[
+]f+f-f+f-d+ RfRfh +Z+S
$ PE L 7 !
` oK
+
0

!! , .
,
.
. ,

.
. ,
,
.
.
.
, (
).
. ,
. ,
19

,

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

.OBJ.
.
, .
, .
,
( .OBJ)

.EXE.
,

.
, . ,
Microsoft Visual Studio

, .
20


, , :
.
, , .
,
Hello world!.
, ,

Microsoft Visual Studio 2013 ->
-> Microsoft Visual Studio 2013
.
, :

, , ,
, . ,
, ,
.
21

. :
, ,
File -> New -> Project.
.
New Project (
) Installed Templates () Visual C++ -> Win32 -> Win32 Console
Application
Location ,
.
C:\Projects ( ,
)

Name Hello.
OK.

22

Application Settings. Empty Project ,


. Security
Development Lifecycle (SDL) checks.
Finish.

,
. ,
.
.
:
23

Solution
Explorer. Ctrl+Alt+L.

Source Files.
Add->Add New Item...

. . C++File
(.cpp) (, /C++).
Name ( )
Hello. Add.
24

Add
, .
C.
,
.
, . .
,
.
, .
, :

25

//
//
// //
/*
,
/* */
/*
iostream. - ,
, .

iostream */
#include <iostream>
/* ++ .
,
. ,
, ,
.
std */
using namespace std;
void main() // ,
//
{
//
// Hello, World!
// cout<<
// ,
cout<<"Hello, World!\n";
// .
// .
}

,
. , . , ,
. , C,
. ,
. Build (), Rebuild Solution
( )

26

, .
. . Debug Start
Without Debugging.

27

28

! . ?
,
(Press any key to continue).


Visual Studio (
). File Open ->Project/
Solution .

29

,
.
Sources.
/Sources/Hello.

30

4.
, cout<<
.
, ,
:
1.
#include <iostream>
2. ,
cout.
using namespace std;

3. ,
cout<<, . :
cout<< , ;

cout<< ,
.
,
\ ,
, .
Escape-. :

31

\b
\n
\t
\\
\"
\'




\

'

Escape- .
,
: " \ ' ?
, , ,
. ,
,
. , :
The Man in red was "old friend" of John...

Escape-,
, :
cout<<The Man in red was "old friend" of John...;

.
, cout<<''The
Man in red was". was , , . , ,
. :
32

cout<<The Man in red was \"old friend\" of John...;

, , cout<<
Escape-.
, , Escape- , . . ,
. , :
cout<<'' My name is''<<'' - Ira\n '';
cout<<''I'm from Odessa\n '';
cout<<''My eyes are blue"<<"\n ''<<"That`s all!!!";
:
My name is - Ira
I'm from Odessa
My eyes are blue
That`s all!!!

cout<<
,
Escape-.
, :
\b Backspace
\n
New line
\t
Horizontal tab
\\
Backslash \
\"
Double quotation mark "
\'
Single quotation mark '

33

Visual Studio 2013.


EscapeSequences. , .
//
#include <iostream>
// , cout<<
using namespace std;
//
void main()
{
/* 4
Escape Sequences
*/

cout<<"\t\t\t\tEscape Sequences\n";
//

cout<<"\n";
/* 2 \b,
1 Backspace
\n */

cout<<"\t\t\\b"<<"\tBackspace\n";
//

cout<<"\n";
/* 2 \n,
1 New line
\n */

cout<<"\t\t\\n"<<"\tNew line\n";
//

cout<<"\n";
/* 2 \t,
1 Horizontal tab
\n */

cout<<"\t\t\\t"<<"\tHorizontal tab\n";
//

cout<<"\n";
/* 2 \\,
1 Backslash \
\n */

cout<<"\t\t\\\\"<<"\tBackslash \\\n";
//

cout<<"\n";
/* 2 \t,
1 Double quotation mark "
\n */

cout<<"\t\t\""<<"\tDouble quotation mark \"\n";
//

cout<<"\n";
/* 2 \',
1 Single quotation mark '

34

\n */
cout<<"\t\t\'"<<"\tSingle quotation mark \'\n";
//

cout<<"\n";

(Build -> Rebuild Solution).


,
:

,
#include <iostream> ,
cout (using namespace std;)
main ().
.
main()
{ }
.
(Debug -> Start Without Debugging).
P. S.
,
. ,
Windows,
MS DOS. ,
. .
MS DOS Windows ,

. , Windows:
35

cout<<"";

, Windows, ,
238, DOS .
.
.
C++ 11

. raw .
raw
.

.
R"(_)"

R , raw .
. :
cout<<R"(hello\nworld)"; // hello\nworld
cout<<R"("Test 'string'\t")"; // "Test 'string'\t"
cout<<R"((Such brackets))"; // (Such brackets)

36

5.
, ,
,
- .
//
#include <iostream>
// , cout<<
using namespace std;
//
void main()
{

// " !!! :)"

// ,

//

cout<<"\t\t\tCongratulation with good beginning!!! :)\n\n";
}

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

. - - , . ,
. , ,
37

,
. , .
, ( ) ,
.
, .
,
.
:
1. .
2. .
3. .
,
.
.
, , .
. , ,
, . 7,8
7.8
, , float double.
? float
, double . ,
, .
, , .
:
38


float
4


double 8


. :

short



4
-2147483648
2147483647
2
-32768 32767

int

long

long
long

-2147483648
2147483647
9,223,372,036,
854,775,808 9,223,372,
036,854,775,807

.
.

.

char

39

.
.
.
:
(true) (false).

bool



1
true false

:
,
unsigned. ,
unsigned int. 0 4294967294.
, ,
. , ,
(. .
). ,

. , . . int ,
INT .

.

40

6.


.
,
, .
, , .
,
, .
,

.
:

, .
.
- 26 , 27.
,
( ,
).
.
, - .
41

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

:
1. .
.
, Age age .
2. . ,
. , Name1 ,
1Name .
3. _. ,
, ,
.
,
. , : ageofman Age_Of_Man.

:
1.
. ,
(int, float,double . .). Visual Studio
42

,
.
2.
.
3. ,
.(. )
.

() . ,
:
1. _ _;
,
. .
?
,
.
, ,
=
2. _ _=;
, .
.
3. const _ _=;
.
,
const.
.
.
43

.

cout<<
cout<<_; //

<<
cout<<_1<<_2;
//


Escape- <<
cout<<""<<_1
<<""<<_2<<"\n";


.

.
.
: , , ,
..
44

, ,
:
int Age;
? Age () .
int Age.
, Age
34. ?
Age =34;
: Age
34.
: Age =34;
,
. ,
.
, :
const int Count_Days_in_Week=7;
? const ,
. int , .
Count_Days_in_Week 7.
, .
? :
2000 ?
?
,
.
.
45

2000 366 , 24 . 2000 : 366 24.


* (, Shift+8).
,
2000 .
.
,
.
: 366. ,
DayIn_2000Year. 24.
.
HourInDay.
, .
HourIn_Year2000. . (int)
:
1. .
2. .
3. .
( ).
,
:

46

//
#include <iostream>
// , cout<<
using namespace std;
//
void main()
{
//
cout<<"\n";
//
int DayIn_2000Year=366;
int HourInDay=24;
//
int HourIn_Year2000;
//
// HourIn_Year2000
HourIn_Year2000=DayIn_2000Year*HourInDay;
// HourIn_Year2000
cout<<"\t\t In 2000 year "<< HourIn_Year2000;
cout<<" hours\n ";
}

! !
.

float Weight;
Weight=12.3452;
double weight_atom;
weight_atom= 2.5194+017;

2.5194+017?
.
. .
251940000000000000
2,15941017.

47

3.4008 : 3,410-8,
3,4:108.
1.5E+003 1,5103.
float
3,41038 3,41038.
3,4-38 3,41038
.
:
, .
(Cost), (Count), ,
(Discount), (Price).
Pokupka
//
#include <iostream>
// , cout<<
using namespace std;
//
void main()
{
// Discount
float Discount=0.05;
// Cost
float Cost=10.50;
// Count
int Count=5;
// Price
float Price;
// Price
Price=Count*Cost-Count*Cost*Discount;
//
cout<<"Please, pay:"<<Price<<"\n";
}

48

. , ,
.

.
.
. .
//
bool Flag;
Flag=true;
//
char Symbol='A';
/* Escape - ,

char*/
const char NewLine='\n';
cout<<NewLine//

49

7.

cout,
-
,
- .
. ,

. .
,
cin. ? :
cin>>_;

_ ,
, :
:
cin>>Age;

, ,
ge. ,
Number,
:
cin>>Number;
50

,
:
cin>>_1>>_2>>...>>_N;


,
.
,
>>.
cin>>Quantity>>Price>>Discount;

Pokupka
:
//
#include <iostream>
// , cout<<
using namespace std;
//
void main()
{

// Discount

float Discount=0.05;

// Cost

float Cost=10.50;

//

cout<<"What's the cost?\n";

// Cost

cin>>Cost;

// Count

int Count=5;

//

cout<<"How much?\n";

// Count

cin>>Count;

// Price

float Price;

// Price

51

Price=Count*Cost-Count*Cost*Discount;
//
cout<<"Please, pay:"<<Price<<"\n";

cin>>.
,
. ,
""(Enter).
.
.
-: ,
.
Game :
//
#include <iostream>
// , cout<<
using namespace std;
//
void main()
{

// " !"

cout<<"Let's play!\n";

// i

int i;

// " "

cout<<"Enter a number:";

//

cin>>i;

// , ""

cout<<"I have "<<i+1<<"\n";

//

cout<<"I'm winner!\n";
}

52

.
. ,
. ,
, "Enter a number:"
67:
Let's play!
Enter a number: 67
I have 68
I'm winner!
Press any key to continue...

?

cout<<"I have "<<i+1<<"\n";

i, , 1,
, 1
.
i+1 i-1, ,

.
+() ().
. ,
/.
,
.
53

8.
(literals) , .
, , . ,
,
.
:
5
5l
true
5.0
5.0f
0.32
'd'
"Visual"

-int
l L long
-bool
, double
f F , float
double, e E


, .
,
- .

, .
//"abrakadabra" - '\n' -
cout<<"abrakadabra"<<'\n';
int a = 2; // 2 - int

54


.
,
. !

55

9.
1. , .
2. ,
$,, .
3. :
"To be or not to be"
\Shakespeare\
4. C .
, , .
5.
.

56

57

58

59

60

61

62

63

64

Вам также может понравиться