| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 82873 | 胡盛哲 | 情报加密 | C++ | Compile Error | 0 MS | 0 KB | 663 | 2024-07-13 16:07:24 |
include <iostream> using namespace std; int main() { string s; getline(cin, s); string result = " "; for (int i = 0; i < s.length(); i++) { char c = s[i]; if ((c >= 'a' && c < 'z') || (c >= 'A' && c < 'Z')) { result += char(c + 1); } else if (c == 'z') { result += 'a'; } else if (c == 'Z') { result += 'A'; } else { result += c; } } size_t start = result.find_first_not_of(' '); if (start != string::npos) { result = result.substr(start); } cout << result << endl; return 0; }
Main.cc:1:1: error: 'include' does not name a type
include
^
Main.cc: In function 'int main()':
Main.cc:5:4: error: 'string' was not declared in this scope
string s;
^
Main.cc:6:12: error: 'cin' was not declared in this scope
getline(cin, s);
^
Main.cc:6:17: error: 's' was not declared in this scope
getline(cin, s);
^
Main.cc:6:18: error: 'getline' was not declared in this scope
getline(cin, s);
^
Main.cc:7:11: error: expected ';' before 'result'
string result = " ";
^
Main.cc:11:12: error: 'result' was not declared in this scope
result += char(c + 1);
^
Main.cc:13:12: error: 'result' was not declared in this scope
result += 'a';
^
Main.cc:15:12: error: 'result' was not declared in this scope
result += 'A';
^
Main.cc:17:12: error: 'result' was not declared in this scope
result += c;
^
Main.cc:20:4: error: 'size_t' was not declared in this scope
size_t start = result.find_first_not_of(' ');
^
Main.cc:21:8: error: 'start' was not declared in this scope
if (start != string::npos) {
^
Main.cc:21:17: error: 'string' is not a class, namespace, or enumeration
if (start != string::npos) {
^
Main.cc:22:8: error: 'result' was not declared in this scope
result = result.substr(start);
^
Main.cc:24:4: error: 'cout' was not declared in this scope
cout << result << endl;
^
Main.cc:24:12: error: 'result' was not declared in this scope
cout << result << endl;
^
Main.cc:24:22: error: 'endl' was not declared in this scope
cout << result << endl;
^