关于这个数字赋值,之前我们已经讲过了一些,我们再来回顾一下
#include <iostream>
using namespace std;
int main ()
{
short s;// 数字定义
int i;// 数字定义
long l;// 数字定义
float f;// 数字定义
double d;// 数字定义
s = 10; // 数字赋值
i = 1000; // 数字赋值
l = 1000000; // 数字赋值
f = 230.47; // 数字赋值
d = 30949.374; // 数字赋值
cout << "short s :" << s << endl;// 数字输出
cout << "int i :" << i << endl;// 数字输出
cout << "long l :" << l << endl;// 数字输出
cout << "float f :" << f << endl;// 数字输出
cout << "double d :" << d << endl;// 数字输出
return 0;
}