我正在尝试学习C#,并且有一个基本问题:我尝试从用户读取两个值,但它不起作用。这是我在C#中的代码:
int a = 0;
int n = 0;
int s = 0;
Console.WriteLine("Please enter the basic value");
a = Console.Read();
Console.WriteLine("Please enter the power");
n = Console.Read();
// Console.ReadKey();
do
{
s = s * a;
n--;
}
while (n > 1);
Console.WriteLine("the solution is:" + s);
Console.ReadKey();