Вы находитесь на странице: 1из 2



:
: 18.10.2012
, ,
. . , ,
, . ?
.
. , 100 6 ,
6/100=0.06. , ,
.
.
, 10 1000
- ? . .
, :
int _tmain(int argc, _TCHAR* argv[]) {
char buf[4];

printf("Enter your name: ");


scanf("%s", buf);
printf("Name: %s\n", buf);

printf("Enter your surname: ");


scanf("%s", buf);
printf("Surname: %s\n", buf);

return 0;
}
(, , ) scanf.
: 2/10=0.2.
, "" :
void my_scanf(char buf[]) {

scanf("%s", buf);
}

int _tmain(int argc, _TCHAR* argv[]) {


char buf[4];

printf("Enter your name: ");


my_scanf(buf);
printf("Name: %s\n", buf);

printf("Enter your surname: ");


my_scanf(buf);
printf("Surname: %s\n", buf);

return 0;
}
, : 1/13=
0.08! , .
, , .
. ,
.

Оценить