d 以十进制形式输出带符号整数(正数不输出符号) o 以八进制形式输出无符号整数(不输出前缀O) x 以十六进制形式输出无符号整数(不输出前缀OX) u 以十进制形式输出无符号整数 f 以小数形式输出单、双精度实数 e 以指数形式输出单、双精度实数 g 以%f%e中较短的输出宽度输出单、双精度实数 c 输出单个字符 s 输出字符串
#include"stdio.h" void main(){ char c; printf("input a character: "); c=getchar(); if(c<32) printf("This is a control character/n"); else if(c>='0'&&c<='9') printf("This is a digit/n"); else if(c>='A'&&c<='Z') printf("This is a capital letter/n"); else if(c>='a'&&c<='z') printf("This is a small letter/n"); else printf("This is an other character/n"); } if(c<32) printf("This is a control character/n"); else if(c>='0'&&c<='9') printf("This is a digit/n"); else if(c>='A'&&c<='Z') printf("This is a capital letter/n"); else if(c>='a'&&c<='z') printf("This is a small letter/n"); else printf("This is an other character/n");