C Tutorial/printf scanf/scanf field width — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 10:32, 25 мая 2010
inputting data with a field width
#include <stdio.h>
int main()
{
int x;
int y;
printf( "Enter a six digit integer: " );
scanf( "%2d%d", &x, &y );
printf( "The integers input were %d and %d\n", x, y );
return 0;
}
Enter a six digit integer: 1 2 The integers input were 1 and 2