using System; |
namespace demo4 |
{ |
class Bignum |
{ |
public static void Main( string [] args) |
{ |
Console.WriteLine( "请输入一个乘数:" ); |
uint x = uint .Parse(Console.ReadLine()); |
Console.WriteLine( "请输入另一个乘数:" ); |
uint y = uint .Parse(Console.ReadLine()); |
ulong z = 0; |
//uint 为32位整数 |
for ( int i = 0; i<32; i++) |
{ |
if (y % 2 == 1) |
z += x; |
x <<= 1; |
y >>= 1; |
} |
Console.WriteLine( "The result is :{0}" ,z); |
} |
} |
} |
by: 发表于:2018-01-12 14:34:02 顶(0) | 踩(0) 回复
??
回复评论