不同格式,大小写
1 #include <stdio.h> 2 3 int main(void) 4 { 5 int a = 99; 6 printf("%D, %d, %#D, %#d\n", a, a, a, a); 7 printf("%O, %o, %#O, %#o\n", a, a, a, a); 8 printf("%X, %x, %#X, %#x\n", a, a, a, a); 9 }
1 #include <stdio.h> 2 3 int main(void) 4 { 5 //1. short int 6 printf("%hd\n", 65535); 7 printf("%hu\n", 65535); 8 9 //2. char 10 printf("%hhd\n", 255); 11 printf("%hhu\n", 255); 12 }