二. 读程序题 默认有关变量x、y、z、a、b、c、i均为unsigned int (8为无符号数)请写出局部程序运行后的结果,用十进制表示。 1. x = ______, y = ______, z = ______ , a = ______, b = ______, c = ______。 x = 50/8; y = 100%12; z = 240+26; a = z>>1; b = x | z; c = ~y; 2. x = ______, y = ______, z = ______ , a = ______, b = ______, c = ______。 x = 0xa5 ^ 0x12; y = 5*2; z = y++ a = --z; b = a & y; c = (a+z)/2; 3. x = ______, y = ______, i = ______。 x=0;y=0; for (i=1;i<=3;i++){ x = x+i; y = y + i*2; } 4. x = ______, y = ______, z = ______ , a = ______, b = ______, c = ______, i = ______。 a=0; if (!a){ x=20; y=x<<2; z=y++; }else{ x=10; y=x<<2; z=y++; } i=2<<2; y=10; if (i>3 && y){ a=y & 0x0c; b=++i; c=x^y; }
二. 读程序题 默认有关变量x、y、z、a、b、c、i均为unsigned int (8为无符号数)(这个是不是打错了)请写出局部程序运行后的结果,用十进制表示。 1. x = ___6___, y = ___3___, z = __11____ , a = ___5___, b = ___15___, c = ___252___。 x = 50/8; y = 100%12; z = 240+26; a = z>>1; b = x | z; c = ~y; 2. x = _183_____, y = __10____, z = __11____ , a = __10____, b = __10____, c = ___10___。 x = 0xa5 ^ 0x12; y = 5*2; z = y++ a = --z; b = a & y; c = (a+z)/2; 3. x = ___6___, y = __12____, i = ___3___。 x=0;y=0; for (i=1;i<=3;i++){ x = x+i; y = y + i*2; } 4. x = __20____, y = ___10___, z = ___81___ , a = __8____, b = ____9__, c = __48____, i = ___8___。 a=0; if (!a){ x=20; y=x<<2; z=y++; }else{ x=10; y=x<<2; z=y++; } i=2<<2; y=10; if (i>3 && y){ a=y & 0x0c; b=++i; c=x^y; } 随便做的,有些东东忘了!不懂的自己回去看看书去。