#include<iostream>
using namespace std;
int main()
{
//1、整形
/*int a = 0;
cout << "请给整型变量a赋值:" << endl;
cin >> a;
cout << "整型变量a = :" << a << endl;*/
// 浮点型
/*float f = 0.0f;
cout << "请给浮点型变量f赋值:" << endl;
cin >> f;
cout << "浮点型变量f = :" << f << endl;*/
// 字符型
/*char ch = ' ';
cout << "请给字符类型变量ch赋值:" << endl;
cin >> ch;
cout << "字符型变量str = :" << ch << endl;*/
// 字符串类型
/*string str = "";
cout << "请给字符串类型变量str赋值:" << endl;
cin >> str;
cout << "字符串型变量str = :" << str << endl;*/
// 布尔型
bool b = false;
cout << "请给布尔型变量b赋值:" << endl;
cin >> b;
cout << "布尔型变量f = :" << b << endl;
system("pause");
return 0;
}
|