字典翻译 问答 其它 C#阶乘问题计算阶乘.比如用户在TextBox里输入7,就会显示:Thefactorialof1is1Thefactorialof2is2Thefactorialof3is6Thefactorialof4is24Thefactorialof5is120Thefactorialof6is720Thefactorialof7is5040.这
问题标题:
C#阶乘问题计算阶乘.比如用户在TextBox里输入7,就会显示:Thefactorialof1is1Thefactorialof2is2Thefactorialof3is6Thefactorialof4is24Thefactorialof5is120Thefactorialof6is720Thefactorialof7is5040.这
问题描述:

C#阶乘问题

计算阶乘.比如用户在TextBox里输入7,就会显示:

Thefactorialof1is1

Thefactorialof2is2

Thefactorialof3is6

Thefactorialof4is24

Thefactorialof5is120

Thefactorialof6is720

Thefactorialof7is5040

.

这是我的代码,这是乘方,怎么写阶乘?

//Declarevariables

intnumRow=0;

inti=0;

publiccalculateButton()

{

InitializeComponent();

}

privatevoidbuttonCalculate_Click(objectsender,EventArgse)

{

if(int.TryParse(textBoxnumber.Text,outnumRow)==true)

{

for(inti=1;i

么莉回答:
  在最前面加:   doublesum=1;   和   inti=0;一起   for语句内修改:   for(inti=1;i
点击显示
其它推荐
热门其它推荐
  • 其它