Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139310 刘益梵 22破解密码 C++ Compile Error 0 MS 0 KB 384 2025-12-06 14:16:47

Tests(0/0):


Code:

#include <iostream> #include <string> using namespace std; int main() { string input; getline(cin, input); // 读取输入的密码字符串 string output = ""; // 遍历字符串,步长为3 for (int i = 0; i < input.length(); i += 3) { output += input[i]; } cout << output << endl; return 0; }


Run Info:

Main.cc:1:10: error: #include expects "FILENAME" or 
 #include <iostream>
          ^
Main.cc:2:10: error: #include expects "FILENAME" or 
 #include <string>
          ^
Main.cc: In function 'int main()':
Main.cc:6:5: error: 'string' was not declared in this scope
     string input;
     ^
Main.cc:7:13: error: 'cin' was not declared in this scope
     getline(cin, input);  // 读取输入的密码字符串
             ^
Main.cc:7:18: error: 'input' was not declared in this scope
     getline(cin, input);  // 读取输入的密码字符串
                  ^
Main.cc:7:23: error: 'getline' was not declared in this scope
     getline(cin, input);  // 读取输入的密码字符串
                       ^
Main.cc:8:12: error: expected ';' before 'output'
     string output = "";
            ^
Main.cc:11:24: error: 'lt' was not declared in this scope
     for (int i = 0; i < input.length();  i += 3) {
                        ^
Main.cc:11:42: error: expected ')' before ';' token
     for (int i = 0; i < input.length();  i += 3) {
                                          ^
Main.cc:11:45: error: 'i' was not declared in this scope
     for (int i = 0; i < input.length();  i += 3) {
                                             ^
Main.cc:15:5: error: 'cout' was not declared in this scope
     cout << output << endl;
     ^
Main.cc:15:11: error: 'lt' was not declared in this scope
     cout << output << endl;
           ^
Main.cc:15:19: error: 'output' was not declared in this scope
     cout << output << endl;
                   ^
Main.cc:15:35: error: 'endl' was not declared in this scope
     cout << output << endl;
                                   ^