程序清单3.5 chartype.cpp

// chartype.cpp -- the char type
#include <iostream>
int main()
{
    using namespace std;

    char ch;
    cout << "Enter a character: " << endl;
    cin >> ch;
    cout << "Hola!! ";
    cout << "Thank you for the " << ch << " character." << endl;

    return 0;
}

输出:

Enter a character: 
M
Hola!! Thank you for the M character.

猜你喜欢

转载自blog.csdn.net/m0_38101326/article/details/88072185
3.5
cpp