Open dushaoshuai opened 2 years ago
// bases.c -- prints 16 in decimal, octal, and hex #include <stdio.h> int main(void) { int x = 16; printf("dec = %d; octal = %o; hex = %x\n", x, x, x); printf("dec = %d; octal = %#o; hex = %#x\n", x, x, x); printf("dec = %d; octal = %#o; hex = %#X\n", x, x, x); return 0; } // Output: // dec = 16; octal = 20; hex = 10 // dec = 16; octal = 020; hex = 0x10 // dec = 16; octal = 020; hex = 0X10
基本数据类型
进制