#include<stdio.h>标签:练习题,11111111,00000000,补码,char,整型,原码,提升 From: https://blog.51cto.com/u_13606048/6112903
int main() {
char a = -1;
//-1原码=10000000 00000000 00000000 00000001
//-1反码=11111111 11111111 11111111 11111110
//-1补码=11111111 11111111 11111111 11111111
//char只能存储一个字节长度:a=11111111
signed char b = -1;
//同理,b=11111111
unsigned char c = -1;
//同理,c=11111111
printf("%d %d %d", a, b, c);
//a整型提升(有符号位):11111111 11111111 11111111 11111111(补码)
//b整型提升(有符号位):11111111 11111111 11111111 11111111(补码)
//两者原码:10000000 00000000 00000000 00000001=-1
//c整型提升(无符号位):00000000 00000000 00000000 11111111(补码=反码=原码)c=255
return 0;
}