1、
#include
using namespace std;
int main()
{
char ch = 's';
cout << ch << endl;
cout << "char所占的内存空间为" << sizeof(char) << endl;
cout << (int)ch << endl;
system("pause");
return 0;
}
2、
#include
using namespace std;
int main()
{
cout << "hello worldn";
system("pause");
return 0;
}
#include
using namespace std;
int main()
{
cout << "\"<
return 0;
}
#include
using namespace std;
int main()
{
cout << "sstuuu"<
cout << "sssssstuuu" << endl;
cout << "ssssssstuuu" << endl;
system("pause");
return 0;
}
3、
#include
using namespace std;
int main()
{
char str[] = "qwer";
cout << str << endl;
system("pause");
return 0;
}
#include
using namespace std;
#include
int main()
{
string str = "qwer";
cout << str << endl;
system("pause");
return 0;
}
4、
#include
using namespace std;
int main()
{
bool flag = true;
cout << flag << endl;
cout << "bool所占用的内存空间为:" << sizeof(bool) << endl;
system("pause");
return 0;
}
5、
#include
using namespace std;
int main()
{
int a = 0;
cout << "请输入整型a的值:" << endl;
cin >> a;
cout << "整型a的值:" < system("pause");
return 0;
}
#include
using namespace std;
int main()
{
float f = 0;
cout << "请输入浮点型f的值:" << endl;
cin >> f;
cout << "浮点型f的值:" <
return 0;
}
#include
using namespace std;
int main()
{
char ch = '0';
cout << "请输入字符型ch的值:" << endl;
cin >> ch;
cout << "字符型ch的值:" <
return 0;
}
#include
using namespace std;
#include
int main()
{
string str = "0";
cout << "请输入字符串型str的值:" << endl;
cin >> str;
cout << "字符串型str的值:" <
return 0;
}
#include
using namespace std;
int main()
{
bool flag = true;
cout << "请输入布尔型flag的值:" << endl;
cin >> flag;
cout << "布尔型flag的值:" <
return 0;
}



