小编eks*_*nte的帖子

在c中使用fscanf读取整数失败

FILE *fin = fopen("figura.in", "r");
if(fscanf(fin, "%d %d %d %d", &int[0], &int[1], &int[2], &int[3]) == 1)     {
        printf("%d\t%d\t%d\t%d\n", int[0], int[1], int[2], int[3]);
    } else {
        printf("failed to read integer.\n");
    }
Run Code Online (Sandbox Code Playgroud)

我无法读取整数.文件没问题,它包含4个整数.怎么了?

c scanf

2
推荐指数
1
解决办法
1133
查看次数

修饰符'private'对C#中的此项无效

它给了我这样一个错误,我似乎无法弄清楚问题是什么.

private void Form1.KeyDown(object sender, KeyEventArgs e)  // **THE ERROR HERE**   
    {
        if (ListBox1.Items.Contains(e.KeyCode))
        {
            ListBox1.Items.Remove(e.KeyCode);
            ListBox1.Refresh();
            if (timer1.Interval > 400)
            {

                timer1.Interval -= 10;
            }
            if (timer1.Interval > 250)
            {
                timer1.Interval -= 7;

            }
            if (timer1.Interval > 100)
            {
                timer1.Interval -= 2;

            }
            difficultyProgressBar.Value = 800 - timer1.Interval;
            stats.Update(true);


        }
        else
        {

            stats.Update(false);

        }


        correctLabel.Text = "Correct: " + stats.correct;
        missedLabel.Text = "Missed: " + stats.missed;
        totalLabel.Text = "Total: " + stats.total;
        accuracyLabel.Text = "Accuracy: " + stats.accuracy + …
Run Code Online (Sandbox Code Playgroud)

c# keydown

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

标签 统计

c ×1

c# ×1

keydown ×1

scanf ×1