-
. .
, , . . .
1 -
endl | ; |
ends | ( ); |
flush | ; |
dec | ( ); |
oct | ; |
hex | ; |
setw (int n) | n (n ); |
setfill(int n) | -, ; |
setprecision(int n) | ; |
setbase(int n) | ; n 0, 2, 8, 10, 16, 0 , .. 10. |
. :
int x = 53;
cout << " : " << dec << x << endl
<< " : " << oct << x << endl
<< " :" << hex << x << endl;
. :
double x;
//
// 6 (3 ,
// 2 )
cout << setw ( 6 ) << setprecision ( 2 ) << x << endl;
( endl ends) . . , , , ws. , ( , , ) . .
int x;
//
cin >> hex >> x;
- stdio.h
- stdio.h.
printf(_,_);
, .
|
|
.
#include "stdafx.h"
#include <stdio.h>
void main ()
{
printf ( "\nhello!\n" );
}
#include <stdio.h> -. \n ( ).
, :
% _.
% .
5
- | . |
+ | + -. |
, , -. | |
# |
_ , .
, .
6.
6
N | |
F | |
h | short int |
l | long |
L | long double |
.
7
d | (int) | |
i | (int) | |
o | ||
u | ||
x | (a,b,c,d,e,f) | |
X | (A,B,C,D,E,F) | |
f | [+/-]ddd.dddd | |
e | [+/-]d.dddd | |
g | f, e ( ) | |
E | , e | |
G | , g | |
s | - | |
c | - |
:
printf(|n summa=%f,summa);
:
Summa=2102.3
:
float c=48.3, e=16.33;
int k=-83;
printf(\nc=%f\tk=%d\te=%e,c,k,e);
c=48.299999 k=-83 e=1.63300e+01
:
printf(\nc=%5.2f\tk=%5d\te=%8.2f\te=%11.4e,c,k,e,e);
c=48.30 k= -83 e=16.33 e= 1.6330e+01
:
\n ;
\t ;
\r ;
\\ \;
\ ;
\0 ;
\a -;
\b ;
\f ;
\v ;
\? .
|
|
scanf(_, _);
. , .
%*_
* ;
_ , , .
printf().
, . & _
:
scanf(%d%f%f,&n,&z,&x);
- , -(<stdio.h>):
puts(const char* ); . .
char *gets(char* s); . .
int putch(int ); .
int getch(void); . , getch 0. , , , , getch . getch , .
cputs(const char* ); .