世界机器人大会青少年机器人设计与信息素养大赛2025-2026 学年算法应用主题赛 / 初中组wrc.hao.work
WRCWorld Robot Contest青少年算法应用训练档案馆
四大文化场景完整题库档案HTTPS 资料库
02-solution/src/cpp/main.cpp

main.cpp

站内文件视图直接读取仓库内容,Markdown 使用文档排版渲染,其余文本文件保持原始排版,方便校对训练证据链。

文件类型.cpp

10-cases/s4-jh-03-promotion-forecast/02-solution/src/cpp/main.cpp

#include <iostream>
#include <string>
#include <vector>

using namespace std;

string solve(const string& input) {
    int line_count = 0;
    for (char ch : input) {
        if (ch == '\n') {
            ++line_count;
        }
    }
    if (!input.empty() && input.back() != '\n') {
        ++line_count;
    }
    return "s4-jh-03-promotion-forecast: scaffold-ready | input_lines=" + to_string(line_count);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string input;
    string line;
    bool first = true;
    while (getline(cin, line)) {
        if (!first) {
            input += "\n";
        }
        first = false;
        input += line;
    }

    cout << solve(input) << "\n";
    return 0;
}