求助,一道C语言程序题!!!
c++吧
全部回复
仅看楼主
level 6
#include "stdio.h"
main()
{
char ch1,ch2;
ch1='A'+'5'+'3';
ch2='A'+'6'-'3';
printf("%d,%c",ch1,ch2);
}
以上程序输出结果是-87,D。。
求高手给我讲解-87是怎么运算出来的!!!!!!!!!!!!!!!!!!!!!!!!
2011年11月02日 00点11分 1
level 6
高手勿喷我,小弟发错了。求吧主删帖。[Kiss]
2011年11月02日 00点11分 2
level 13
ASCII自己查
顺手修正两行:
#include <stdio.h>
int main()
2011年11月02日 00点11分 3
level 6
ch1='A'+'5'+'3';
//ch1=65+53+51=169
//在内存中表示是 1010 1001
//显然第1位是1表示负数 所以就是-87
如果你unsigned char ch1; 结果才会是169
2011年11月02日 04点11分 5
1