Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137417 余秋烨 07苹果和虫子 C++ Compile Error 0 MS 0 KB 472 2025-11-17 17:02:52

Tests(0/0):


Code:

#include <iostream> using namespace std; int main() { int n, x, y; // 读取输入的三个正整数 cin >> n >> x >> y; // 计算被吃掉的苹果数量 int eaten_apples = 0; // 如果y能被x整除,说明刚好被整数个虫子吃完 if (y % x == 0) { eaten_apples = y / x; } else { // 否则需要向上取整,因为即使吃不满也要算一个完整的苹果 eaten_apples = y / x + 1; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:8: warning: variable 'eaten_apples' set but not used [-Wunused-but-set-variable]
    int eaten_apples = 0;
        ^
Main.cc:18:4: error: expected '}' at end of input
    }
    ^