?Java?,????printf?????????????????????:
- ??????:????%Nd????????,??N?????????,"d"?????????10??????,?????????????
int num = 123; System.out.printf("d\n", num);
?????:
123
- ????:????%.Nf?????????????,??N?????????,"%.2f"??????????2????
double num = 123.456789; System.out.printf("%.2f\n", num);
?????:
123.46
????????,?????????????????,?????????????????????%N??????%.N?????,?????????????