保证AC
2025-08-15 19:22:34
发布于:四川
2阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, caseNumber = 1;
while (true) {
cin >> n;
if (n == 0) break;
cout << "Case " << caseNumber++ << ":" << endl;
cout << "#include<string.h>" << endl;
cout << "#include<stdio.h>" << endl;
cout << "int main()" << endl;
cout << "{" << endl;
cin.ignore();
for (int i = 0; i < n; ++i) {
string line;
getline(cin, line);
cout << "printf(\"";
for (char c : line) {
if (c == '"') cout << "\\\"";
else if (c == '\\') cout << "\\\\";
else cout << c;
}
cout << "\\n\");" << endl;
}
cout << "printf(\"\\n\");" << endl;
cout << "return 0;" << endl;
cout << "}" << endl;
}
}
这里空空如也
有帮助,赞一个