Upload
infernoplex
View
23
Download
0
Embed Size (px)
DESCRIPTION
d des
Citation preview
-
C C++ [-] : ..
, . .. . C C++.
C++
C#
Java
C
C
C++
Windows- Visual C#
C# 2.0
0.
. 1.
C C++. ,
2.
Borland C++, ver 3.1, Borland C++ Builder. ,
3.
. ,
4.
. , ,
5.
C C++.
6.
. ,
7.
.
8.
.
9.
- , .
10.
. ,
11.
. , .
12.
Borland C++ 3.1 Borland C++ 3.1. ,
13.
. C++ . ,
14.
. .
15.
, .
16.
, , , .
- http://www.INTUIT.ru
C C++
0. : . : PDA
, . .. . , C, C++ 2- " ", Turbo Pascal 7.0, Delphi 6. Borland C++ (ver 3.1) Borland C++ Builder (ver 5.0). .
.. , . .
C++ , . Bell Labs , C (. BCPL, . B). , , Unix PDP-7, 1969 . , GE-645, , Multics. . (, Multics) , . GE-645 75$, .
, . , PDP-7 . . . Unix , .. Multics. 1970 . Unix PDP-11. , . C, . 1973 . . Unix C ( ).
1974 Unix C . Unix, , . Unix, 90% , C, Unix.
C 1983 Bell Labs . C++ ( C ). , , -, .
C, C++, Borland, , . , , , . Turbo Pascal, Turbo C. . .
C++. Visual C++ Microsoft. . Borland Borland C++ ( 3.1, 4, 5), Borland C++ Builder. , . Intel. Symantec.
1. : C: PDA C++. ,
INCLUDEPICTURE "http://www.intuit.ru/img/empty.gif" \* MERGEFORMATINET
INCLUDEPICTURE "http://www.intuit.ru/img/empty.gif" \* MERGEFORMATINET C++, a b, .
01 #include
02 #include
03 int main(void)
04 {
05 int a,b,max;
06 cout > a; //
08 cout > b; // b10 if(a>b) max=a; // a>b max=a
11 else max=b; // max=b
12 cout x2 >> x3;
d. , x1, x2, - x3. , , , . Enter. , , , , . , . , cin.
, . .
iostream.h:
#include
int main()
{ int i;
float f;
double d;
..........
cin >> i >> f >> d;
char unsigned char , .. , . .
3.5.2.
, scanf, :
#include
int main()
{ int i;
float f;
double d;
..........
scanf("%d %f %lf",&i,&f,&d);
(stdin), . - Enter.
scanf , , , , , . .
i ( - &i), int, %d. , (d - decimal, ). f float %f. , , . d double %lf (l - long).
, , scanf, , . , . . :
scanf("%d %*l %lf",&i,&d);
, . , , , . , , ( , ).
, scanf , . , .. scanf , .
, , . , scanf, :
%[*][][{l|h|L}]{d|i|u|o|x|X|f|e|E|g|G}
, . , . % , .
* . , , , , . l, h L (l, L - long; h - short). . 3.3.
3.3.
d
i
u
o
x,X
f
e,E
g,G
char. , scanf - 2 . char. , . - char .
BC 3.1 short int - %d, %i, %u, %o, %x %X. long - %ld, %li, %lu, %lo, %lx %lX.
BCB h - %hd, %hi, %hu, %ho, %hx %hX. %d %ld .
, - 0x 0X , 0 . %d , . %i (i - integer) , . %o, %x %X , .
float - %f, %e, %E, %g %G. , . double l - %lf, %le, %lE, %lg %lG. long double %Lf, %Le, %LE, %Lg %LG.
3.6.
3.6.1.
(stdout), , printf. :
#include
int main()
{ int i;
float f;
double d;
..........
printf("%d %f %lf", i+1, f, f*d);
scanf , , , , .
, :
%[][][.][{l|h|L}]{d|i|u|o|x|X|f|e|E|g|G}
, . , , . . , . , , , .
[-,+,,0,#]. "" ( ). "" ( ). "" , "+" . "" , .
# , . , - 0x 0X. f, e, E ( , , 0, ). g G .
. 3.4 3.5, , I=555 R=5.5 .
( , ). , -5 %8.4d , , -0005.
. , . , float 3.14159265, %10.8f 3.14159274. , .. float 7-8 .
3.4.
%6d %6o %8x
%-+#0+555010530x22b
%-+#+555010530x22b
%-+0+5550105322b
%-++5550105322b
%-#0555010530x22b
%-#555010530x22b
%-0555105322b
%-555105322b
%+#0+005550010530x00022b
%+#+555010530x22b
%+0+005550010530000022b
%++555105322b
%#00005550010530x00022b
%#555010530x22b
%00005550010530000022b
%555105322b
3.5.
%10.2e %10.2f
%-+#0+5.50e+00+5.50
%-+#+5.50e+00+5.50
%-+0+5.50e+00+5.50
%-++5.50e+00+5.50
%-#05.50e+005.50
%-#5.50e+005.50
%-05.50e+005.50
%-5.50e+005.50
%+#0+005.50e+00+0000005.50
%+#+5.50e+00+5.50
%+0+005.50e+00+0000005.50
%++5.50e+00+5.50
%#0005.50e+000000005.50
%#5.50e+005.50
%0005.50e+000000005.50
%5.50e+005.50
%0x %0X , [a,b,c,d,e,f], - [A,B,C,D,E,F].
( char) - %o, %0x, %0X, %i, %d, %ho, %hx, %hX, %hi, %hd. %u. , , . 127 %u . -5, 65531 ( ).
- ( %f %lf) ( %e %E). %g %G , . , "e".
- . . , , . , :
x1=127; x2=-350;
printf("x1=%d x2=%d",x1,x2);
:
x1=127 x2=-350
, "\n":
printf("\nx1=%d x2=%d",x1,x2);
. C, C++ "\" ( Escape-), . 3.6.
3.6.
\a ( 0x07, BEL)\\ \
\b ( 0x08, Backspace)\' '
\f ( 0x0C, FF)\" "
\n ( 0x0A, LF)\? ?
\r ( 0x0D, CR)\0xxx xxx
\t ( 0x09, HT)\xhh hh
\v ( 0x0B, VT)\xHH HH
.
3.6.2.
(stdout) :
#include
int main()
{ int i;
float f;
double d;
..........
cout