int a; char b; cin >> a; cout << char(a); cin>>b; cout<<int(b);
#include "stdio.h" int main() { int a = 49; char b = 'A'; printf("49 = %c\nA = %d", a, b); //将整数型以字符方式输出,字符型以整数输出. scanf(" "); } //输出 //49 = 1 //A = 65