Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137428 刘柠锐 07苹果和虫子 C++ Compile Error 0 MS 0 KB 399 2025-11-17 17:08:58

Tests(0/0):


Code:

#include <iostream> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; int eaten_apples = 0 if (y % x == 0) { eaten_apples = y / x; } else { eaten_apples = y / x + 1; } int remaining_apples = n - eaten_apples; if (remaining_apples < 0) { remaining_apples = 0; } cout << remaining_apples << endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:4: error: expected ',' or ';' before 'if'
    if (y % x == 0) {
    ^
Main.cc:9:6: error: 'else' without a previous 'if'
    } else {
      ^