C++ Primer Plus P41 程序清单3.5
用户输入字符,对字符类型的输出
/*
C++ Primer Plus P41 程序清单3.5
对字符类型的输出
*/
//头文件
#include<iostream>
//主函数
int main(void)
{
using namespace std; //编译指令
char ch; //字符类型ch
cout << "Enter a character:" << endl; //提醒用户输入
cin >> ch; //输入的字符流入ch
cout << "Hola! Thank you for the " << ch << " character." << endl; //输出结果
return 0;
}
小程序,配合书看哦
书籍:C++ Primer Plus
感谢观看
再次感谢~