C#用一维数组求解问题

利用一维数组求解问题。读入若干(1-15个)整数(一行输入,空格分隔),每个数在10-100之间的整数包括10和100。在读入每个数时,确认这个数的有效性(在10到100之间),并且若它和之前读入的数不一样,就把它存储到数组中,无效的数不存储。读完所有数之后,仅显示用户输入的不同的数值。

MimShift()函数

MimShift()函数

Synopsis

Perform a point-to-point bit shift.

Format

void MimShift(SrcImageBufId, DestImageBufId, BitsToShift)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
long BitsToShift; Number of bits to shift
Description

This function performs left or right bit-shifting on each pixel in the specified image. The shift operation is signed or unsigned depending on the source image buffer’s data type.
The SrcImageBufId parameter specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.
The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.

The BitsToShift parameter specifies the number of bits to shift. If the given value is negative, each pixel in the specified image is right bit-shifted by the specified number of bits; otherwise, it is left bit-shifted.

巧用移位操作

移位时,移出的位数全部丢弃,移出的空位补入的数与左移还是右移有关。如果是左移,则规定补入的数全部是0;如果是右移,还与被移位的数据是否带符号有关。若是不带符号数,则补入的数全部为0;若是带符号数,则补入的数全部等于原数的最左端位上的原数(即原符号位)。