C++例题1:输出可打印字符

#include<iostream>
#include<stdlib.h>
#include<cctype>
int main()
{
int i;char a=0;
for(i=0;i<128;i++)
{
if(isprint(a))
{
std::cout<<a<<" ";
std::cout<<std::dec<<i<<" ";
std::cout<<std::hex<<i<<std::endl;
a++;
}
else a++;
}
system("pause");
return 0;
}

What doesn't kill you makes you stronger,stand a little taller Doesn't mean I'm lonely when I'm alone. What doesn't kill you makes a fighter,Footsteps even lighter Doesn't mean I'm over cause you're gone. ————即便生命枯竭,亦在优雅中变老。
原文地址:https://www.cnblogs.com/yexu200241/p/3791125.html