小编use*_*892的帖子

我这个代码做错了什么?

private void btnCalculate_Click(object sender, EventArgs e)
{
    //variable declarations
    int num;

    //clear the listbox
    lstPwrs.Items.Clear();

    //add header to listbox
    lstPwrs.Items.Add("N\tN^2\tN^3");

    //each subsequent line is displayed as N is incremented 
    //use a while loop to do this, as you must be able to create 
    //the proper output for any upper limit the user enters

    //initialize loop variable, then loop
    num = Convert.ToInt32( txtInput.Text );
    while ( num <= 5 )
    ++num;
    {
        lstPwrs.Items.Add( Math.Pow( num, 1 ) + "\t" + Math.Pow( …
Run Code Online (Sandbox Code Playgroud)

.net c#

0
推荐指数
1
解决办法
88
查看次数

标签 统计

.net ×1

c# ×1