c 头文件(二)

时间:2023-03-09 18:30:30
c 头文件<ctype.h>(二)

测试<ctype.h>函数

 #include <stdio.h>
#include <ctype.h> int main(){ int num = ;
for(int i = ; i < ; ++i){
if(isalnum(i)){
printf("%d\t'%c'\t", i, i);
++num;
}
if(num == ){
num = ;
puts("");
}
}
puts("");
return ;
}

显示结果

c 头文件<ctype.h>(二)

 #include <stdio.h>
#include <ctype.h> int main(){ int num = ;
for(int i = ; i < ; ++i){
if(isalpha(i)){
printf("%d\t'%c'\t", i, i);
++num;
}
if(num == ){
num = ;
puts("");
}
}
puts("");
return ;
}

c 头文件<ctype.h>(二)

 #include <stdio.h>
#include <ctype.h> int main(){ for(int i = ; i < ; ++i){
if(isdigit(i)){
printf("ASCII=%d\t'%c'\n", i, i);
}
}
return ;
}

c 头文件<ctype.h>(二)