using System;
class My
{
static void Main()
{
int a,b=1;
int n;
Console.WriteLine("請輸入所要求這個數(shù)的次方數(shù):");
n=int.Parse(Console.ReadLine());//n是次方
Console.WriteLine("請輸入所要計算的這個數(shù):");
a=int.Parse(Console.ReadLine());//a是那個數(shù)
for(int i=1;i<=n;i++)
{
b=b*a;
}
Console.WriteLine(a+"的"+n+"次方是:"+b);
}
}
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報。