首页 > 代码库 > 指定精确度(*号的使用)

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

*号的使用

 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 }