M
Miros
Unregistered / Unconfirmed
GUEST, unregistred user!
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
W: Word;
B, G, R: Byte;
begin
{ TODO -oUser -cConsole Main : Insert code here }
W := 40000;
WriteLn('I: ' + IntToStr(W));
B := W Shr 11;
G := W Shl 5 Shr 10;
R := W Shl 11 Shr 11;
WriteLn('R: ' + IntToStr(R) + ',' + 'G: ' + IntToStr(G) + ',' + 'B: ' + IntToStr(B));
W := B Shl 11 + G Shl 5 + R;
WriteLn('I :' + IntToStr(W))
//为什么前后结果中W的值不同呢? 要怎么算呢?
ReadLn(W);
end.
//不好意思 刚才题目问得太含糊了
//我的目的是想知道如何运算 B , G , R 可以返回的W的值!
{$APPTYPE CONSOLE}
uses
SysUtils;
var
W: Word;
B, G, R: Byte;
begin
{ TODO -oUser -cConsole Main : Insert code here }
W := 40000;
WriteLn('I: ' + IntToStr(W));
B := W Shr 11;
G := W Shl 5 Shr 10;
R := W Shl 11 Shr 11;
WriteLn('R: ' + IntToStr(R) + ',' + 'G: ' + IntToStr(G) + ',' + 'B: ' + IntToStr(B));
W := B Shl 11 + G Shl 5 + R;
WriteLn('I :' + IntToStr(W))
//为什么前后结果中W的值不同呢? 要怎么算呢?
ReadLn(W);
end.
//不好意思 刚才题目问得太含糊了
//我的目的是想知道如何运算 B , G , R 可以返回的W的值!