add the way to specify number of decimal places (#31925)

* add the way to specify number of decimal places

* add comma and period
This commit is contained in:
DrakonDarquesse
2018-11-30 02:32:22 +08:00
committed by Jingyi Ding
parent 86641b4ad7
commit be96a8808f

View File

@ -84,6 +84,10 @@ int main { float a = 0.0; scanff”a; //输入是45.65 p
字符串输入s 字符串输入s
可以设定要放多少个小数点:
%.2f 代表只会显示两个小数点。
但只可以放在 printf不能在scanf()里。
# 包括 # 包括
int main { char str \[20\]; scanfs”str; //输入是nitesh printfs \\ n”str; 返回0; } int main { char str \[20\]; scanfs”str; //输入是nitesh printfs \\ n”str; 返回0; }