c语言中 如何让7/3的结果输出2.3。初学者求教 在线等
#include <stdio.h> int main() { printf("%.1f",7/(float)3); }
printf("%f",((float)7/3));
printf("%.2f",7/(float)3);
printf("%.1f", 1.0 * 7 / 3);