?? 實(shí)現(xiàn)一個(gè)數(shù)的n次方.txt
字號:
using System;
class My
{
static void Main()
{
int a,b=1;
int n;
Console.WriteLine("請輸入所要求這個(gè)數(shù)的次方數(shù):");
n=int.Parse(Console.ReadLine());//n是次方
Console.WriteLine("請輸入所要計(jì)算的這個(gè)數(shù):");
a=int.Parse(Console.ReadLine());//a是那個(gè)數(shù)
for(int i=1;i<=n;i++)
{
b=b*a;
}
Console.WriteLine(a+"的"+n+"次方是:"+b);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -