文章目录 精度方面答案是double ,但是题目要求保留到整数: 精度方面 答案是double ,但是题目要求保留到整数: 错误做法 printf("%.f\n",ans); 正确做法 printf("%d\n",(int)ans); 例题