02-solution/src/cpp/main.cpp
main.cpp
站内文件视图直接读取仓库内容,Markdown 使用文档排版渲染,其余文本文件保持原始排版,方便校对训练证据链。
文件类型.cpp
10-cases/s3-jh-03-tech-schedule/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 "s3-jh-03-tech-schedule: 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;
}