全文预览

c程序答案

上传者:塑料瓶子 |  格式:pdf  |  页数:37 |  大小:2958KB

文档介绍
d short moveright(unsigned short value, int n)\r(\runsigned short z ;\rz=(value>>n)|(value<<(16-n));\rreturn(z);\r)\runsigned short moveleft(unsigned short value, int n)\r{\runsigned short z ;\rz=(value<<n)|(value>>(16-n));\rreturn(z);.\r//T\r@A—8cl4_6.c,‘Hüýˆ:BD/þÿ 0@P`p\r?\r????P“\r!"”\r#include<stdio. h>\rvoid main()\r{\runsigned short getbits(unsigned short);\runsigned short int a;\rprintf ("input an octal number:z);\rscanf (%o”, &a);\rprintf ("result:%o\n”, getbits(a));\r)\runsigned short getbits(unsigned short value)\r{\runsigned short int z;\rz=value&0100000;\rif (z==0100000)\rz=~value+l;\relse\rz=value;\rreturn (z);\r)\r//--------------------------------------------------------\rI l \rli-

收藏

分享

举报
下载此文档