第一个程序
#include<iostream>
using std::cout;
using std::endl;
int main()
{
char ch;
ch= 'X';
cout<<ch<<endl;
cout<<(int)ch<<endl;
return 0;
}
第二个程序
#include<iostream>
using std::cout;
using std::endl;
int main()
{
for(int i=32;i<128;i++)
{
cout<<(char)i<<endl;
}
return 0;
}
第三个程序
#include<iostream>
using std::cout;
using std::endl;
int main()
{
char ch='\a';
cout<<"特殊字符开始"<<endl;
for(int i=0;i<3;i++)
{
cout<<ch<<endl;
i++;
}
cout<<"特殊字符结束"<<endl;
return 0;
}