如何输出右对齐且是会计格式的数据?
要求输出:Total Number of Passengers 12,432
Total Dollars Billed $329,425.25
Average Fare Billed $23.75
我的代码是:
printf("Total Number of Passengers %d\n", passenger);
printf("Total Dollars Billed $%.2lf\n", totalamt);
printf("Average Fare Billed $%.2lf\n", totalamt/passenger);
printf里面该怎么改?谢谢。