, , . :
x > 0, x = +0, x1, x2, , [x]. . = 00, x1, x2,
< 0, = -0, 1, 2, , [x]. . = 11, |x1, |x2, + 0,01
, (01 10) .
04.05.2012 . ()
.
% | , | |
d | int | |
D | long int | |
o | int | |
O | long int | |
x, X | int | |
i | , | int |
I | , | long int |
u | unsigned int | |
U | unsigned long int | |
e, E, f, g, G | , | float |
c | . ( ), , , | char |
s | , , null- , | |
% | % | , , % |
n | int, , , | |
p | XXXX:YYYY, X Y | (far* near*) %p , |
, :
%[*][][]
[*] % . , .
[] , . [] , . [] , , , [].
, [] :
N . near ( %Np)
F . far ( %Fp)
H short.
L long.
, scanf fscanf , , , stdin, scanf .
|
|
printf fprintf
, .
/*
C++
f1.out
*/
#include<stdio.h> // -
int main (void) // 0
{
//
float f=1.5e2;
long double
ld=2.0e-3L;
int i=7;
long int li=12l;
short int si=5;
FILE *f_out; //
//
int retcode; // fclose
// f1.out
f_out=fopen(f1.out,w);
if(f_out==NULL)
{
printf(\n );
return 1;
}
// f1.out
fprintf(f_out,% 3OS\n f=%f %5S i=%10d\n,
*, f, , i);
fprintf(f_out, ld=%-Lf f=%15f f=%15.2f f=%+15.2f\n,
ld, f, f, f);
fprintf(f_out, i=%10.5d f=%E li=%ld si=%hi\n,
i, f, li, si);
//
retcode=fclose(f_out);
if(retcode==EOF)
{
printf(\n );
return 2;
}
return 0
}
//