1.
printf("%.1lf\n",8.0/5.0);
2.
const double PI = 4.0 * atan(1.0);
3.
sin与cos都是用的弧度
n/180.0*PI;
4. 四舍五入判断整数x
double x;
floor(x+0.5)==x;
5. 计时函数
#include <time.h>
cout<<(double)clock()/CLOCKS_PER_SEC<<endl;
6.管道输入
echo 20 | ./a.out
7. 重定向读写文件
#define LOCAL
#ifdef LOCAL
freopen("data.in","r",stdin);
freopen("data.out","w",stdout);
printf("%.1lf\n",8.0/5.0);
2.
const double PI = 4.0 * atan(1.0);
3.
sin与cos都是用的弧度
n/180.0*PI;
4. 四舍五入判断整数x
double x;
floor(x+0.5)==x;
5. 计时函数
#include <time.h>
cout<<(double)clock()/CLOCKS_PER_SEC<<endl;
6.管道输入
echo 20 | ./a.out
7. 重定向读写文件
#define LOCAL
#ifdef LOCAL
freopen("data.in","r",stdin);
freopen("data.out","w",stdout);