C/C++
scanf()

#include <stdio.h>
int scanf(const char * format, ...);


stdin

scanf() , stdin , , . .

99 format restrict.

, format, :

  • ;
  • ;
  • , .

- (%) - , . , %s , %d - . , , . .

% ( 99)
% %a ( 99)
%
%d
%i (, , )
%
% %
%f
%F %f( 99)
%g
%G %g
%
%s
%
%X %
%
%n , ,
%u
%[ ]
%%

, l, h. d, i, , .

, f, e g scanf() float. l, scanf() double. L , , , long double.

, 1995 , l , whcar_t. l s, . , l .

scanf() . , . , scanf() , ( ) .

scanf() . , %d, %d scanf() , . , scanf() .

, scanf(), . , .

, . , , .., . ,

scanf("%d%d", &r, &c);

, 10 20, "", 10,20.

*, % , , . ,

scanf("%d%*c%d", &, &);

10/20 10 , 20 .

. , % , , . , address 20 , .

scanf("%20s", address);

20 , , "" scanf(). . scanf() .

, , . , ,

scanf("%%%", &, &, &);

, .

, , ( , ), . , , 10t20,

scanf("%st%s", &, &);

10 20 . t , .

scanf() (scanset). , scanf() . , , . . , , , .

%[]

scanf() , , . . scanf() , .

(^), : , .. scanf() , .

. , scanf() Z.

%[A-Z]

, . , , , .

scanf() , , . , , * . scanf() EOF.

, scanf() 99

99 scanf(): hh, ll, j, z t. hh d, i, , , . , signed char unsigned char. ll d, i, , , . , signed long long int unsigned long long int.

j, d, i, , , n, , intmax_t uintmax_t. <stdint.h> .

z, d, i, , u, x n, , size_t. <stddef.h> sizeof.

t, d, i, , u, x n, , ptrdiff_t. <stddef.h> .






Нет комментариев.



Оставить комментарий:
Ваше Имя:
Email:
Антибот: *  
Ваш комментарий: