Standard formatted output of printf

printf("%0.1lf\n",8.0/5.0);

The content after the percent sign, 1 in front of the decimal point: indicates that the width of the output number is 0; 1 after the decimal point: the precision of the book output by the tender is 1, that is, it is accurate to one decimal place.

lf, l means long, f means float, lf means long float.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325666995&siteId=291194637