//
// main.cpp
// _01day
//
// Created by AchesonD 贪玩巴斯 on 2021/3/18.
//
/*
一、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
//入门级程序 定义变量,创建变量
// 数据类型 变量名 = 值;
#include <iostream>
using namespace std;
int main(){
int a = 10;
cout << "a = " << a << endl;
system("pause");
return 0;
}
*/
/*
二、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
//定义常量的两个方式
#include<iostream>
#define Day 7 // 心得: define 后面的必须大写! 不要写等号上去
using namespace std;
int main(){
const int month = 12;
cout << "一周内总共有" << Day << "天 !" << endl;
cout << "一年内有" << month << "月 !" <<endl;
system("pause");
return 0;
}
*/
/*
三、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
//运用sizeof 来测出四个整型的所占内存大小
//总结 short < int < long < longlong
#include<iostream>
using namespace std;
int main(){
cout << "short 所占内存的大小是" << sizeof(short) << endl;
cout << "int 所占内存大小是" << sizeof(int) << endl;
cout << "long 所占内存大小是" << sizeof(long) << endl;
cout << "long long 所占内存大小是" << sizeof(long long) << endl;
system("pause");
return 0;
}
*/
/*
四、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
//区别双精度和单精度,都是默认小数点后六位。运用sizeof来计算内存大小。拓展科学技术法。
#include<iostream>
using namespace std;
int main(){
float f1 = 3.14f;
double d1 = 3.14;
cout << f1 << endl;
cout << d1 << endl;
cout << "float 的内存是" << sizeof(f1) << endl;
cout << "double 的内存是" << sizeof(d1) << endl;
//科学技术法
float f2 = 3e2; //表示 三 乘以 十 的 二次方
cout << "f2 = " << f2 << endl;
float f3 = 3e-2; //表示 3 乘以 十的负二次方 向左移动两位
cout << "f3 = " << f3 << endl;
system("pause");
return 0;
}
*/