摘要: 本文转载(3-3自己补充,可供参考): 第一章习题1-1#include <stdio.h>int main(){int a,b,c;double d;scanf("%d%d%d",&a,&b,&c);d=(double)(a+b+c);printf("%.3lf\n",d/3.0);return  阅读全文
posted @ 2017-02-12 16:46 lauzhishuai 阅读(1603) 评论(0) 推荐(0) 编辑
摘要: 在C中我们可以使用 printf("%.2lf",a);但在C++中是没有格式操作符的,该如何操作: C++使用setprecision()函数,同时必须包含头文件iomanip,如下: #include"iomanip" using namespace std; …… cout.setf(ios: 阅读全文
posted @ 2017-02-12 15:56 lauzhishuai 阅读(5302) 评论(1) 推荐(0) 编辑