#include <iostream>
int main()
{
using namespace std;
char ch = 'M';//'M'表示M的数值编码
int i = ch;//这里与python不一样,不用加括号
cout<<ch<<" is "<<i<<endl;
ch=ch+1;
i=ch;
cout<<ch<<" is "<<i<<endl;//char显示为字符,int显示为数字
cout<<"Displaying char ch using cout.put(ch): ";
cout.put(ch);
cout.put('$');
cout<<endl<<endl;
return 0;
}
3_5_p41_moechar.cpp
于 2024-07-08 00:32:46 首次发布