1、
#include
using namespace std;
int main()
{
cout << "hello world" << endl;
system("pause");
return 0;
}
2、
#include
using namespace std;
int main()
{
int a = 10;
cout << "a=" << a << endl;
system("pause");
return 0;
}
3、
#include
using namespace std;
#define Day 7
int main()
{
cout << "一周有" << Day <<" 天"<< endl;
system("pause");
return 0;
}
#include
using namespace std;
int main()
{
const int Day = 7;
cout << "一周有" << Day <<" 天"<< endl;
system("pause");
return 0;
}
4、
#include
using namespace std;
int main()
{
float f1 = 3.14f;
double d1 = 3.14;
float f2 = 3e1;
float f3 = 3e-1;
cout << f1 << endl;
cout << d1 << endl;
cout << f2 << endl;
cout << f3 << endl;
cout << "f1所占用的空间为" << sizeof(f1) << endl;
cout << "d1所占用的空间为" << sizeof(d1) << endl;
system("pause");
return 0;
}



