指定精确度(*号的使用)

*号的使用

 1 #include <stdio.h>
 2 
 3 int main(void)
 4 {
 5     unsigned width, precision;
 6     float height;
 7     printf("Please enter you height(enter a tag before):\n");
 8     scanf("%*s %f", &height);
 9     printf("Please enter width and precision:\n");
10     scanf("%d %d", &width, &precision);
11     printf("your weight: --%*.*f--\n", width, precision, height);
12 }

 

posted @ 2014-08-19 22:50  挨踢淫才  阅读(127)  评论(0编辑  收藏  举报