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个整数.怎么了?
它给了我这样一个错误,我似乎无法弄清楚问题是什么.
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)