字符串的表示与基本操作 · GESP C++ 三级 · 传习 四个特殊字符构成。\n\n2. 密码最短长度 $:6$ 个字符,密码最大长度 $:12$ 个字符。\n\n3. 大写字母,小写字母和数字必须至少有其中两种,以及至少有四个特殊字符中的一个。","timeLimitSec":1,"inputFormatMd":"输入一行不含空格的字符串。约定长度不超过 $100$。该字符串被英文逗号分隔为多段,作为多组被检测密码。","memoryLimitMb":512,"outputFormatMd":"输出若干行,每行输出一组合规的密码。输出顺序以输入先后为序,即先输入则先输出。","referenceSolution":{"code":"#include \u003ciostream>\nusing namespace std;\nchar line[101];\nchar pwd[101];\n// 检查从 str 开始、长度为 l 的密码是否合规\nbool check(char * str, int l) {\n if (l \u003c 6 || l > 12)\n return false;\n bool hasC = false, hasL = false, hasD = false, hasS = false;\n for (int i = 0; str[i] != '\\0'; i++) {\n if ('A' \u003c= str[i] && str[i] \u003c= 'Z') {\n hasC = true;\n } else if ('a' \u003c= str[i] && str[i] \u003c= 'z') {\n hasL = true;\n } else if ('0' \u003c= str[i] && str[i] \u003c= '9') {\n hasD = true;\n } else if (str[i] == '!' || str[i] == '@' ||\n str[i] == '#' || str[i] == ' ) {\n hasS = true;\n } else\n return false;\n }\n if (!hasS)\n return false;\n if (hasC + hasL + hasD \u003c 2)\n return false;\n return true;\n}\nint main() {\n cin >> line;\n // 按逗号对输入进行切分,并依次判断\n int len = 0;\n for (int i = 0; line[i] != '\\0'; i++) {\n if (line[i] != ',') {\n pwd[len] = line[i];\n len++;\n } else {\n pwd[len] = '\\0';\n if (check(pwd, len))\n cout \u003c\u003c pwd \u003c\u003c endl;\n len = 0;\n }\n }\n if (len > 0) {\n pwd[len] = '\\0';\n if (check(pwd, len))\n cout \u003c\u003c pwd \u003c\u003c endl;\n }\n return 0;\n}\n","language":"cpp","verification":{"toolchain":"Apple clang version 17.0.0 (clang-1700.6.4.2);g++ -O2 -std=c++14 -I content/_tools/cxx-shim","compiledOk":true,"verifiedAt":"2026-09-05T02:07:55.224Z","reproducesSamples":true}}},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-06-prog-02","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"25845b6a-aa3a-43f6-a713-fc8ef9dfca7b","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-09-sc-12","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":4,"payload":{"stem":"如果 a 为 char 类型的变量,下列哪个表达式可以正确判断“a是大写字母”?( )","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":9,"points":2,"sha256":"91c312701211ff2851b20c72ced5b7307b1694952250bcf324f15af2c79a1fc0","fileUrl":"https://gesp.ccf.org.cn/101/attach/1570611239321632.pdf","paperId":"gesp-cpp-l3-2023-09","section":"single_choice","language":"C++","authority":"official","questionNo":12},"options":[{"id":"A","text":"`a - 'A' \u003c= 26`"},{"id":"B","text":"`'A' \u003c= a \u003c= 'Z'`"},{"id":"C","text":"`'A' \u003c= 'a' \u003c= 'Z'`"},{"id":"D","text":"`('A' \u003c= a) && (a \u003c= 'Z')`"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-09-sc-12","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"e278c50e-bec5-438f-b93a-e85301513354","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-09-tf-03","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":5,"payload":{"stem":"字符常量 `'3'` 的值和 int 类型常量 3 的值是相同的,只是占用的字节数不同。","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":9,"points":2,"sha256":"91c312701211ff2851b20c72ced5b7307b1694952250bcf324f15af2c79a1fc0","fileUrl":"https://gesp.ccf.org.cn/101/attach/1570611239321632.pdf","paperId":"gesp-cpp-l3-2023-09","section":"true_false","language":"C++","authority":"official","questionNo":3},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-09-tf-03","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"94914941-ac32-48e2-89c1-d55408c9ec40","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-12-sc-03","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":6,"payload":{"stem":"下面 C++ 代码执行后不能输出\"GESP\"的是()。","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":12,"points":2,"sha256":"ef6bb91b5ed0d4b380f6ab5ee383711d77ee4c7d9894074cb83eabdc75322ec5","fileUrl":"https://gesp.ccf.org.cn/101/attach/1584917876047904.pdf","paperId":"gesp-cpp-l3-2023-12","section":"single_choice","language":"C++","authority":"official","questionNo":3},"options":[{"id":"A","text":"`string str(\"GESP\"); cout\u003c\u003cstr\u003c\u003cendl;`"},{"id":"B","text":"`string str=\"GESP\"; cout\u003c\u003cstr\u003c\u003cendl;`"},{"id":"C","text":"`string str(\"GESP\"); cout\u003c\u003cstr[1]\u003c\u003cstr[2]\u003c\u003cstr[3]\u003c\u003cstr[4]\u003c\u003cendl;`"},{"id":"D","text":"`string str{\"GESP\"}; cout\u003c\u003cstr\u003c\u003cendl;`"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-12-sc-03","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"5ccfa0e5-4ad8-41b4-84ec-d7be6a6708c6","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-12-sc-05","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":7,"payload":{"stem":"执行下面 C++ 代码后,输出是()。\n```cpp\nstring str=(\"chen\");\nint x=str.length();\nint temp=0;\nfor(int i=0;i\u003c=x;i++)\n{\n temp++;\n}\ncout\u003c\u003ctemp\u003c\u003cendl;\n```","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":12,"points":2,"sha256":"ef6bb91b5ed0d4b380f6ab5ee383711d77ee4c7d9894074cb83eabdc75322ec5","fileUrl":"https://gesp.ccf.org.cn/101/attach/1584917876047904.pdf","paperId":"gesp-cpp-l3-2023-12","section":"single_choice","language":"C++","authority":"official","questionNo":5},"options":[{"id":"A","text":"$4$"},{"id":"B","text":"$2$"},{"id":"C","text":"$5$"},{"id":"D","text":"$3$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-12-sc-05","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"a024a6c9-5f0a-47c3-a509-8a95083373c1","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-12-sc-06","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":8,"payload":{"stem":"执行下面 C++ 代码后输出的是()。\n```cpp\nstring str=(\"chen\");\nint x=str.length();\ncout\u003c\u003cx\u003c\u003cendl;\n```","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":12,"points":2,"sha256":"ef6bb91b5ed0d4b380f6ab5ee383711d77ee4c7d9894074cb83eabdc75322ec5","fileUrl":"https://gesp.ccf.org.cn/101/attach/1584917876047904.pdf","paperId":"gesp-cpp-l3-2023-12","section":"single_choice","language":"C++","authority":"official","questionNo":6},"options":[{"id":"A","text":"$4$"},{"id":"B","text":"$3$"},{"id":"C","text":"$2$"},{"id":"D","text":"$5$"}],"textFidelity":[{"kind":"stray_token","note":"洛谷有题题干多了「第6题」前缀;已按官方 PDF 第 2 页去掉。","locus":"stemMd","nature":"source_alteration","verbatim":"执行下面 C++ 代码后输出的是()。","confirmedBy":"page_image","originalCheck":"restored_from_original"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-12-sc-06","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"abbc2539-095a-4051-b7a1-0fcf05ee037c","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-12-sc-07","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":9,"payload":{"stem":"执行下面 C++ 代码后输出的是()。\n```cpp\nstring str=(\"chen\");\ncout\u003c\u003cstr[5]\u003c\u003cendl;\n```","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":12,"points":2,"sha256":"ef6bb91b5ed0d4b380f6ab5ee383711d77ee4c7d9894074cb83eabdc75322ec5","fileUrl":"https://gesp.ccf.org.cn/101/attach/1584917876047904.pdf","paperId":"gesp-cpp-l3-2023-12","section":"single_choice","language":"C++","authority":"official","questionNo":7},"options":[{"id":"A","text":"输出未知的数"},{"id":"B","text":"输出'n'"},{"id":"C","text":"输出'\\0'"},{"id":"D","text":"输出空格"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-12-sc-07","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"0670789c-4e7e-4b12-b58f-35fa5b8416f0","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-12-sc-09","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":10,"payload":{"stem":"下面 C++ 代码用于统计每种字符出现的次数,当输出为 $3$ 时,横线上不能填入的代码是()。\n```cpp\nstring str=\"GESP is a good programming test!\";\nint x=0;\nfor(int i=0;i\u003cstr.length();i++)\n{\n if(_________)\n {\n x++;\n }\n}\ncout\u003c\u003cx\u003c\u003cendl;\n```","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":12,"points":2,"sha256":"ef6bb91b5ed0d4b380f6ab5ee383711d77ee4c7d9894074cb83eabdc75322ec5","fileUrl":"https://gesp.ccf.org.cn/101/attach/1584917876047904.pdf","paperId":"gesp-cpp-l3-2023-12","section":"single_choice","language":"C++","authority":"official","questionNo":9},"options":[{"id":"A","text":"`str[i]=='o'`"},{"id":"B","text":"`str[i]=='a'+14`"},{"id":"C","text":"`str[i]==115`"},{"id":"D","text":"`str[i]==111`"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-12-sc-09","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"aa759d4c-fd94-4c43-88b6-117c94087c7b","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2023-12-tf-02","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":11,"payload":{"stem":"C++程序执行后,输入 `chen a dai` 输出应该为:`chen`。()\n\n```cpp\nstring str;\ncin>>str;\ncout\u003c\u003cstr;\n```","multi":false,"source":{"exam":"GESP","year":2023,"level":3,"month":12,"points":2,"sha256":"ef6bb91b5ed0d4b380f6ab5ee383711d77ee4c7d9894074cb83eabdc75322ec5","fileUrl":"https://gesp.ccf.org.cn/101/attach/1584917876047904.pdf","paperId":"gesp-cpp-l3-2023-12","section":"true_false","language":"C++","authority":"official","questionNo":2},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2023-12-tf-02","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"32802933-3de7-4c11-8bd4-8d04221cbe78","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-03-sc-05","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":12,"payload":{"stem":"已知字符 `'0'` 的ASCII编码的十进制表示为 $48$,则执行下面 C++ 代码后,输出是( )。\n\n```cpp\nint main()\n{\n string s=\"316\";\n int n=s.length();\n int x=0;\n for(int i = 0; i \u003c n; i++)\n x += s[i];\n cout \u003c\u003c x \u003c\u003c endl;\n\n cout \u003c\u003c endl;\n return 0;\n}\n\n```","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":3,"points":2,"sha256":"36df03b76a0d390976f41c192f39d196449666b2cd74cac3129ffa63c0f0b89f","fileUrl":"https://gesp.ccf.org.cn/101/attach/1602047101108256.pdf","paperId":"gesp-cpp-l3-2024-03","section":"single_choice","language":"C++","authority":"official","questionNo":5},"options":[{"id":"A","text":"10"},{"id":"B","text":"58"},{"id":"C","text":"154"},{"id":"D","text":"316"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-03-sc-05","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"bfb49eff-22f0-46ec-9f12-c96df93425ab","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-03-sc-12","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":13,"payload":{"stem":"定义字符数组 `char str[20] = {'G', 'E', 'S', 'P'};`,则 `str` 的字符串长度为( )。","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":3,"points":2,"sha256":"36df03b76a0d390976f41c192f39d196449666b2cd74cac3129ffa63c0f0b89f","fileUrl":"https://gesp.ccf.org.cn/101/attach/1602047101108256.pdf","paperId":"gesp-cpp-l3-2024-03","section":"single_choice","language":"C++","authority":"official","questionNo":12},"options":[{"id":"A","text":"$4$"},{"id":"B","text":"$5$"},{"id":"C","text":"$19$"},{"id":"D","text":"$20$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-03-sc-12","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"7730fb00-62f1-4768-af6f-2a7ce3cec134","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-03-prog-01","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"code_problem","order":14,"payload":{"name":"字母求和","judge":{"mode":"samples_only","checker":"diff_trim"},"source":{"exam":"GESP","year":2024,"level":3,"month":3,"points":25,"sha256":"36df03b76a0d390976f41c192f39d196449666b2cd74cac3129ffa63c0f0b89f","fileUrl":"https://gesp.ccf.org.cn/101/attach/1602047101108256.pdf","paperId":"gesp-cpp-l3-2024-03","section":"programming","language":"C++","authority":"official","questionNo":1},"samples":[{"input":"3\naAc\n","output":"-61\n"}],"language":"cpp","statementMd":"小杨同学发明了一种新型密码,对于每一个小写英文字母,该小写字母代表了一个正整数,即该字母在字母顺序中的位置,例如字母 `a` 代表了正整数 $1$,字母 `b` 代表了正整数 $2$;对于每一个大写英文字母,该大写字母代表了一个负整数,即该字母的 ASCII 码的相反数,例如字母 `A` 代表了正整数 $-65$。小杨同学利用这种方式对一个整数进行了加密并得到了一个由大写字母和小写字母组成的字符串,该字符串中每个字母所代表数字的总和即为加密前的整数,例如 `aAc` 对应的加密前的整数为 $1+(-65)+3=-61$。\n\n对于给定的字符串,请你计算出它对应的加密前的整数是多少。","textFidelity":[{"kind":"typo","note":"洛谷 B3956 题面作「放缩」;官方 PDF 第 6 页作「方式」,已恢复。","locus":"statementMd","nature":"source_alteration","expected":"利用这种放缩对一个整数进行了加密","verbatim":"利用这种方式对一个整数进行了加密","confirmedBy":"page_image","originalCheck":"restored_from_original"},{"kind":"wrong_value","note":"洛谷把原卷「正整数 -65」改成「负整数 $-65$」;第 6 页图像仍作「正整数 -65」,已按原卷恢复。","locus":"statementMd","nature":"source_alteration","expected":"例如字母 `A` 代表了负整数 $-65$","verbatim":"例如字母 `A` 代表了正整数 $-65$","confirmedBy":"page_image","originalCheck":"restored_from_original"}],"timeLimitSec":1,"constraintsMd":"对于全部数据,保证有 $1 \\le n \\le 10^5$。","inputFormatMd":"第一行一个正整数 $n$,表示字符串中字母的个数。 \n第二行一个由大写字母和小写字母的字符串 `T`,代表加密后得到的字符串。","memoryLimitMb":512,"outputFormatMd":"输出一行一个整数,代表加密前的整数。","referenceSolution":{"code":"#include \u003ciostream>\n#include \u003cassert.h>\n#include \u003ccstdlib>\n#include \u003ccstdio>\n#include \u003ccstring>\nusing namespace std;\nconst int N = 100005;\nchar str[N];\nint main() {\n\n int n;\n cin >> n;\n cin >> str;\n assert(n == strlen(str));\n\n int ans = 0;\n for (int i = 0; i \u003c n; i ++) {\n if (str[i] >= 'a' && str[i] \u003c= 'z')\n ans += str[i] - 'a' + 1;\n else if (str[i] >= 'A' && str[i] \u003c= 'Z')\n ans -= str[i];\n else\n assert(false);\n }\n cout \u003c\u003c ans \u003c\u003c endl;\n return 0;\n}\n","language":"cpp","verification":{"toolchain":"Apple clang version 17.0.0 (clang-1700.6.4.2);g++ -O2 -std=c++14 -I content/_tools/cxx-shim","compiledOk":true,"verifiedAt":"2026-09-05T02:08:20.000Z","reproducesSamples":true}}},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-03-prog-01","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"d5d3d667-ecab-4392-8e3a-f3b32842e93d","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-06-sc-09","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":15,"payload":{"stem":"如果字符串定义为 `char str[] = \"GESP\";`,则字符数组 `str` 的长度为( )。","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":6,"points":2,"sha256":"9649d0c64710da1b749c9fd193b45b056ec36abf56f97e815ef3ae9a9a7f1169","fileUrl":"https://gesp.ccf.org.cn/101/attach/1621071490973728.pdf","paperId":"gesp-cpp-l3-2024-06","section":"single_choice","language":"C++","authority":"official","questionNo":9},"options":[{"id":"A","text":"$0$"},{"id":"B","text":"$4$"},{"id":"C","text":"$5$"},{"id":"D","text":"$6$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-06-sc-09","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"32223cff-bd4b-406e-92f4-58bd44068253","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-06-sc-12","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":16,"payload":{"stem":"已知字符 `'0'` 的ASCII编码的十进制表示为 $48$,则执行下面 C++ 代码后,输出是( )。\n\n```cpp\n#include \u003ciostream>\nusing namespace std;\n\nint main() {\n string s = \"0629\";\n \n int n = s.length();\n int x = 0;\n for(int i = 0; i \u003c n; i++)\n x += s[i];\n \n cout \u003c\u003c x \u003c\u003c endl;\n return 0;\n}\n```","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":6,"points":2,"sha256":"9649d0c64710da1b749c9fd193b45b056ec36abf56f97e815ef3ae9a9a7f1169","fileUrl":"https://gesp.ccf.org.cn/101/attach/1621071490973728.pdf","paperId":"gesp-cpp-l3-2024-06","section":"single_choice","language":"C++","authority":"official","questionNo":12},"options":[{"id":"A","text":"$17$"},{"id":"B","text":"$158$"},{"id":"C","text":"$209$"},{"id":"D","text":"$316$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-06-sc-12","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"e3517f6a-cf0e-4343-84d9-9fa299e6bc8d","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-06-sc-14","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":17,"payload":{"stem":"下面可以正确输出 `They're planning a party for their friend's birthday.` 的 C++ 语句是?( )","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":6,"points":2,"sha256":"9649d0c64710da1b749c9fd193b45b056ec36abf56f97e815ef3ae9a9a7f1169","fileUrl":"https://gesp.ccf.org.cn/101/attach/1621071490973728.pdf","paperId":"gesp-cpp-l3-2024-06","section":"single_choice","language":"C++","authority":"official","questionNo":14},"options":[{"id":"A","text":"`cout \u003c\u003c 'They\\'re planning a party for their friend\\'s birthday.\" \u003c\u003c endl;`"},{"id":"B","text":"`cout \u003c\u003c \"They\\'re planning a party for their friend's birthday.'\u003c\u003c endl;`"},{"id":"C","text":"`cout \u003c\u003c 'They're planning a party for their friend's birthday.'\u003c\u003c endl;`"},{"id":"D","text":"`cout \u003c\u003c \"They\\'re planning a party for their friend\\'s birthday.\" \u003c\u003c endl;`"}],"textFidelity":[{"kind":"typo","note":"洛谷把选项 A 字符串收尾引号录成单引号;原卷为双引号(与开头单引号不配对)。已按 PDF 第 6 页恢复。","locus":"options[0].textMd","nature":"source_alteration","expected":"cout \u003c\u003c 'They\\'re planning a party for their friend\\'s birthday.' \u003c\u003c endl;","verbatim":"cout \u003c\u003c 'They\\'re planning a party for their friend\\'s birthday.\" \u003c\u003c endl;","confirmedBy":"page_image","originalCheck":"restored_from_original"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-06-sc-14","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"519e131a-b0b9-4273-9cd2-48072af1237e","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-06-tf-04","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":18,"payload":{"stem":"字符常量 `'\\0'` 常用来表示字符串结束,和字符常量 `'0'` 相同。","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":6,"points":2,"sha256":"9649d0c64710da1b749c9fd193b45b056ec36abf56f97e815ef3ae9a9a7f1169","fileUrl":"https://gesp.ccf.org.cn/101/attach/1621071490973728.pdf","paperId":"gesp-cpp-l3-2024-06","section":"true_false","language":"C++","authority":"official","questionNo":4},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-06-tf-04","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"e4aaaf63-b3fe-45dd-8873-132b965de1da","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-09-tf-08","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":19,"payload":{"stem":"下列程序将输出 `A`。( )\n\n```cpp\nint a=65;\ncout\u003c\u003c(char)a\u003c\u003cendl;\n```","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":9,"points":2,"sha256":"bd4c2bd3957401c3540fe8177761a6cc58cc14ff718e12e7f73e75cc447251af","fileUrl":"https://gesp.ccf.org.cn/101/attach/1644702761746464.pdf","paperId":"gesp-cpp-l3-2024-09","section":"true_false","language":"C++","authority":"official","questionNo":8},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-09-tf-08","guideForCardId":null,"createdAt":"2026-09-05T02:36:29.270Z","updatedAt":"2026-09-05T02:36:29.270Z","guideFor":null,"challengePassed":null},{"id":"6526e9bc-b809-4a3a-8af8-329b117f2578","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-12-sc-09","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":20,"payload":{"stem":"下列程序输出的是( )。\n\n```cpp\nstring ch=\"hello\";\nif(ch[5]==NULL)\n{\n cout\u003c\u003c\"right\"\u003c\u003cendl;\n}\nelse if (ch[5]=='\\0')\n{\n cout\u003c\u003c\"wrong\"\u003c\u003cendl;\n}\nelse\n{\n cout\u003c\u003c\"hello\"\u003c\u003cendl;\n}\n```","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":12,"points":2,"sha256":"18906aab7b63314ee328d203d49b216dc893252f68230e0335b1c345dbfd91f4","fileUrl":"https://gesp.ccf.org.cn/101/attach/1650388837072928.pdf","paperId":"gesp-cpp-l3-2024-12","section":"single_choice","language":"C++","authority":"official","questionNo":9},"options":[{"id":"A","text":"`right`"},{"id":"B","text":"`wrong`"},{"id":"C","text":"`hello`"},{"id":"D","text":"不能正确执行"}],"textFidelity":[{"kind":"layout","note":"洛谷有题在运算符两侧加空格;已按官方 PDF 第 3 页列位恢复。","locus":"stemMd","nature":"source_alteration","verbatim":"if(ch[5]==NULL)","confirmedBy":"page_image","originalCheck":"restored_from_original"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-12-sc-09","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.089Z","guideFor":null,"challengePassed":null},{"id":"6599af61-9d5a-4112-aa5e-4ce53af9684d","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-12-sc-10","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":21,"payload":{"stem":"下列程序中,假设一个字符占用的内存空间是 $1$,下列程序中,`ch` 占用的内存空间是( )\n\n```cpp\nchar ch[] = \"hello world\";\nsize_t ret=strlen(ch);\ncout\u003c\u003cret\u003c\u003cendl;\n```","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":12,"points":2,"sha256":"18906aab7b63314ee328d203d49b216dc893252f68230e0335b1c345dbfd91f4","fileUrl":"https://gesp.ccf.org.cn/101/attach/1650388837072928.pdf","paperId":"gesp-cpp-l3-2024-12","section":"single_choice","language":"C++","authority":"official","questionNo":10},"options":[{"id":"A","text":"$11$"},{"id":"B","text":"$10$"},{"id":"C","text":"$13$"},{"id":"D","text":"$12$"}],"textFidelity":[{"kind":"layout","note":"洛谷有题在 = / \u003c\u003c 两侧加空格;已按官方 PDF 第 3 页列位恢复。","locus":"stemMd","nature":"source_alteration","verbatim":"size_t ret=strlen(ch);","confirmedBy":"page_image","originalCheck":"restored_from_original"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-12-sc-10","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.091Z","guideFor":null,"challengePassed":null},{"id":"5e55f396-bc83-4eb0-a77b-2bff669f1ec0","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2024-12-tf-07","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":22,"payload":{"stem":"```cpp\nstring ch=\"chen\";\ncout\u003c\u003cch[4]\u003c\u003cendl;\n```\n\n该段程序将不能正确执行","multi":false,"source":{"exam":"GESP","year":2024,"level":3,"month":12,"points":2,"sha256":"18906aab7b63314ee328d203d49b216dc893252f68230e0335b1c345dbfd91f4","fileUrl":"https://gesp.ccf.org.cn/101/attach/1650388837072928.pdf","paperId":"gesp-cpp-l3-2024-12","section":"true_false","language":"C++","authority":"official","questionNo":7},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2024-12-tf-07","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.094Z","guideFor":null,"challengePassed":null},{"id":"65a98944-aec3-45f7-a270-80c12364a9cf","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-03-sc-14","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":23,"payload":{"stem":"想要得到字符串 world,下面程序横线处应该填入的是()\n\n```cpp\n#include \u003ciostream>\n#include \u003cstring>\nusing namespace std;\n\nint main() {\n string str = \"HelloC++\";\n _____________\n _____________\n return 0;\n}\n```\n\nA.\n```cpp\nstr.insert(4, \"World\");\ncout \u003c\u003c str.substr(4, 4);\n```\n\nB.\n```cpp\ncout \u003c\u003c str.substr(5, 5);\n```\n\nC.\n```cpp\nstr.insert(\"World\");\ncout \u003c\u003c str.substr(5, 5);\n```\n\nD.\n```cpp\nstr.insert(5, \"World\");\ncout \u003c\u003c str.substr(5, 5);\n```","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":3,"points":2,"sha256":"b7e9c17c562b99757a88c1909a96258f27b7f45145ad9f3a46b0d1d54c5deefa","fileUrl":"https://gesp.ccf.org.cn/101/attach/1670868226801696.pdf","paperId":"gesp-cpp-l3-2025-03","section":"single_choice","language":"C++","authority":"official","questionNo":14},"options":[{"id":"A","text":"A"},{"id":"B","text":"B"},{"id":"C","text":"C"},{"id":"D","text":"D"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-03-sc-14","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.097Z","guideFor":null,"challengePassed":null},{"id":"ea55fdec-fd78-4ed2-b627-46908850d295","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-06-sc-13","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":24,"payload":{"stem":"C++ 代码 `string s = \"GESP考试\";`,s 占据的字节数是( )","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":6,"points":2,"sha256":"c1214e7b1134f988ee8fa9b967be0d5d0bf48d51f836427048ce7e69c96f605a","fileUrl":"https://gesp.ccf.org.cn/101/attach/1699464809021472.pdf","paperId":"gesp-cpp-l3-2025-06","section":"single_choice","language":"C++","authority":"official","questionNo":13},"options":[{"id":"A","text":"10"},{"id":"B","text":"8"},{"id":"C","text":"8 或 10"},{"id":"D","text":"取决于计算机采用什么编码"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-06-sc-13","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.099Z","guideFor":null,"challengePassed":null},{"id":"7844b057-cc29-414f-9eef-4ce78abfe320","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-06-sc-15","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":25,"payload":{"stem":"字符串 \"Gesp考试\",字符数是( )","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":6,"points":2,"sha256":"c1214e7b1134f988ee8fa9b967be0d5d0bf48d51f836427048ce7e69c96f605a","fileUrl":"https://gesp.ccf.org.cn/101/attach/1699464809021472.pdf","paperId":"gesp-cpp-l3-2025-06","section":"single_choice","language":"C++","authority":"official","questionNo":15},"options":[{"id":"A","text":"10"},{"id":"B","text":"8"},{"id":"C","text":"6"},{"id":"D","text":"字符数多少取决于编码"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-06-sc-15","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.101Z","guideFor":null,"challengePassed":null},{"id":"9b6fd9a1-56c4-4439-9429-da7691c03fb4","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-06-tf-01","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":26,"payload":{"stem":"C++ 中 `string` 的 `==` 运算符比较的是字符串的内存地址,而非内容。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":6,"points":2,"sha256":"c1214e7b1134f988ee8fa9b967be0d5d0bf48d51f836427048ce7e69c96f605a","fileUrl":"https://gesp.ccf.org.cn/101/attach/1699464809021472.pdf","paperId":"gesp-cpp-l3-2025-06","section":"true_false","language":"C++","authority":"official","questionNo":1},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-06-tf-01","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.103Z","guideFor":null,"challengePassed":null},{"id":"e08be240-1ae9-4e47-a1f3-6c08f9e4b669","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-06-tf-02","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":27,"payload":{"stem":"`string` 的 `substr(1, 3)` 返回从下标 $1$ 开始的 $3$ 个字符的子串。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":6,"points":2,"sha256":"c1214e7b1134f988ee8fa9b967be0d5d0bf48d51f836427048ce7e69c96f605a","fileUrl":"https://gesp.ccf.org.cn/101/attach/1699464809021472.pdf","paperId":"gesp-cpp-l3-2025-06","section":"true_false","language":"C++","authority":"official","questionNo":2},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-06-tf-02","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.106Z","guideFor":null,"challengePassed":null},{"id":"0a82fbd4-051f-4714-a6a2-5082a318f516","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-06-tf-04","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":28,"payload":{"stem":"`string(\"hello\") == \"hello\"` 的比较结果为 `true`。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":6,"points":2,"sha256":"c1214e7b1134f988ee8fa9b967be0d5d0bf48d51f836427048ce7e69c96f605a","fileUrl":"https://gesp.ccf.org.cn/101/attach/1699464809021472.pdf","paperId":"gesp-cpp-l3-2025-06","section":"true_false","language":"C++","authority":"official","questionNo":4},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-06-tf-04","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.108Z","guideFor":null,"challengePassed":null},{"id":"4767fa37-6aea-4afa-a8c7-a374a2757337","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-06-tf-07","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":29,"payload":{"stem":"`string` 的 `substr(2, 10)` 在字符串长度不足时会抛出异常。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":6,"points":2,"sha256":"c1214e7b1134f988ee8fa9b967be0d5d0bf48d51f836427048ce7e69c96f605a","fileUrl":"https://gesp.ccf.org.cn/101/attach/1699464809021472.pdf","paperId":"gesp-cpp-l3-2025-06","section":"true_false","language":"C++","authority":"official","questionNo":7},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-06-tf-07","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.110Z","guideFor":null,"challengePassed":null},{"id":"3866082f-8d49-404a-9588-683ec533c661","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-09-sc-15","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":30,"payload":{"stem":"以下关于 C++ 中 `string` 类和字符数组(`char[]`)的说法,错误的是( )。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":9,"points":2,"sha256":"9d498145166ef002cead99e73efa9ddc5c87e1c82a7cd7058e63f969800d768f","fileUrl":"https://gesp.ccf.org.cn/101/attach/1703975921385504.pdf","paperId":"gesp-cpp-l3-2025-09","section":"single_choice","language":"C++","authority":"official","questionNo":15},"options":[{"id":"A","text":"`string` 对象可以使用 `=` 进行赋值,而字符数组需要使用 `strcpy`。"},{"id":"B","text":"`string` 对象的长度可以使用 `length()` 成员函数获取,而字符数组需要使用 `strlen()` 函数。"},{"id":"C","text":"`string` 对象在内存中是动态分配空间的,因此可以自动处理字符串长度的变化。"},{"id":"D","text":"`string` 对象和字符数组都可以使用 `==` 运算符来直接比较两个字符串的内容是否相同。"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-09-sc-15","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.113Z","guideFor":null,"challengePassed":null},{"id":"67a58487-2d7c-44c8-95d0-28287922e9b1","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-09-tf-01","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":31,"payload":{"stem":"表达式 `sizeof('a')` 的结果总是 $1$,因为 `'a'` 是一个字符。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":9,"points":2,"sha256":"9d498145166ef002cead99e73efa9ddc5c87e1c82a7cd7058e63f969800d768f","fileUrl":"https://gesp.ccf.org.cn/101/attach/1703975921385504.pdf","paperId":"gesp-cpp-l3-2025-09","section":"true_false","language":"C++","authority":"official","questionNo":1},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-09-tf-01","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.115Z","guideFor":null,"challengePassed":null},{"id":"16d4f8ca-c6c6-4249-9413-4189cc33313b","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-12-tf-03","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":32,"payload":{"stem":"`strcmp(str1, str2)` 返回 0 表示 str1 大于 str2,返回正数表示两者相等。","multi":false,"source":{"exam":"GESP","year":2025,"level":3,"month":12,"points":2,"sha256":"0bc5efa99dd7be2a4d737b58e645d9084c0e048d961e41f8def580e2078739d3","fileUrl":"https://gesp.ccf.org.cn/101/attach/1723012369874976.pdf","paperId":"gesp-cpp-l3-2025-12","section":"true_false","language":"C++","authority":"official","questionNo":3},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-12-tf-03","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.117Z","guideFor":null,"challengePassed":null},{"id":"042fda68-b66f-496b-a615-f77e598f9673","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2025-12-prog-01","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"code_problem","order":33,"payload":{"name":"密码强度","judge":{"mode":"samples_only","checker":"diff_trim"},"source":{"exam":"GESP","year":2025,"level":3,"month":12,"points":25,"sha256":"0bc5efa99dd7be2a4d737b58e645d9084c0e048d961e41f8def580e2078739d3","fileUrl":"https://gesp.ccf.org.cn/101/attach/1723012369874976.pdf","paperId":"gesp-cpp-l3-2025-12","section":"programming","language":"C++","authority":"official","questionNo":1},"samples":[{"input":"6\nPAs1s2an\n1a2bCql3\nPa12bsna\nab1da3cd\nPaabdbcd\nPa2\n","output":"Y\nY\nY\nN\nN\nN\n","explainMd":"- 密码 `PAs1s2an` 是安全密码(有 $8$ 位、包含大写字母 `P`、`A` 和数字 `1`、`2`)。\n- 密码 `1a2bCql3` 是安全密码(有 $8$ 位、包含大写字母 `C` 和数字 `1`、`2`、`3`)。\n- 密码 `Pa12bsna` 是安全密码(有 $8$ 位、包含大写字母 `P` 和数字 `1`、`2`)。\n- 密码 `ab1da3cd` 不是安全密码(没有大写字母)。\n- 密码 `Paabdbcd` 不是安全密码(没有数字)。\n- 密码 `Pa2` 不是安全密码(只有 $3$ 位,太短了)。"}],"language":"cpp","statementMd":"小杨是学校网络安全小组的成员,今天他的任务是设计一个“密码强度检测器”,帮助同学们检查自己的密码是否足够安全。一个安全的密码需要满足以下条件:\n\n- 密码至少包含 $8$ 个字符(太短的密码容易被猜出来哦!)。\n- 密码至少包含一个大写字母(A、B、C、...、Z 都可以)。\n- 密码至少包含一个数字(0、1、2、3、...、9 都可以)。\n\n例如:\n\n- 密码 `PAs1s2an` 是安全密码(有 $8$ 位、包含大写字母 `P`、`A` 和数字 `1`、`2`)。\n- 密码 `ab1da3cd` 不是安全密码(没有大写字母)。\n- 密码 `Paabdbcd` 不是安全密码(没有数字)。\n- 密码 `Pa2` 不是安全密码(只有 $3$ 位,太短了)。","timeLimitSec":1,"constraintsMd":"对于所有测试点,保证 $1 \\leq T \\leq 100$,并且每组密码长度不超过 $100$ 且至少为 $1$,每组密码仅由大小写字母和数字组成。","inputFormatMd":"第一行一个正整数 $T$,代表需要安全检测的密码组数。\n\n对于每组密码,一行包含一个字符串,代表需要安全检测的密码。","memoryLimitMb":512,"outputFormatMd":"对于每组密码,输出一行,如果满足强度要求输出 Y,否则输出 N。","referenceSolution":{"code":"#include \u003ciostream>\n#include \u003cstring>\nusing namespace std;\nint main() {\n int T;\n cin >> T;\n while (T--) {\n string password;\n cin >> password;\n\n bool has_upper = false;\n bool has_digit = false;\n\n for (size_t i = 0; i \u003c password.length(); ++i) {\n if (isupper(password[i])) {\n has_upper = true;\n }\n if (isdigit(password[i])) {\n has_digit = true;\n }\n }\n\n if (password.length() >= 8 && has_upper && has_digit) {\n cout \u003c\u003c \"Y\\n\";\n } else {\n cout \u003c\u003c \"N\\n\";\n }\n }\n return 0;\n}\n","language":"cpp","verification":{"toolchain":"Apple clang version 17.0.0 (clang-1700.6.4.2);g++ -O2 -std=c++14 -I content/_tools/cxx-shim","compiledOk":true,"verifiedAt":"2026-09-05T00:28:13.347Z","reproducesSamples":true}}},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2025-12-prog-01","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.120Z","guideFor":null,"challengePassed":null},{"id":"0315117c-cc11-4e43-8b6e-f3f538020234","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-03-sc-01","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":34,"payload":{"stem":"如果字符变量 `_1` 的值是字符 $1$,那么 `(int) _1` 的值是? ( )。","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":3,"points":2,"sha256":"16be70a6edb8b7947285995bb18f0dd5c3c118113b14ae34c6c08da35984defe","fileUrl":"https://gesp.ccf.org.cn/101/attach/1734775052173344.pdf","paperId":"gesp-cpp-l3-2026-03","section":"single_choice","language":"C++","authority":"official","questionNo":1},"options":[{"id":"A","text":"$1$"},{"id":"B","text":"-$1$"},{"id":"C","text":"$49$"},{"id":"D","text":"$+1$ 或者 -$1$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-03-sc-01","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.122Z","guideFor":null,"challengePassed":null},{"id":"383bc74e-b840-4496-8038-82b7c6102961","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-03-sc-03","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":35,"payload":{"stem":"关于下列正确的程序段,说法正确的是( )。\n\n```cpp\nchar str1[] = \"Hello\";\nchar str2[] ={'H','e','l','l','0'};\n```","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":3,"points":2,"sha256":"16be70a6edb8b7947285995bb18f0dd5c3c118113b14ae34c6c08da35984defe","fileUrl":"https://gesp.ccf.org.cn/101/attach/1734775052173344.pdf","paperId":"gesp-cpp-l3-2026-03","section":"single_choice","language":"C++","authority":"official","questionNo":3},"options":[{"id":"A","text":"字符数组 str1 和 str2 完全相同。"},{"id":"B","text":"```cpp\ncout\u003c\u003cstr1\u003c\u003cendl;\ncout\u003c\u003cstr2\u003c\u003cendl;\n```\n\n这段程序多次执行将输出不同的结果。"},{"id":"C","text":"字符数组 str1 和 str2 不相等。"},{"id":"D","text":"这两个赋值方式完全相同。"}],"textFidelity":[{"kind":"layout","note":"洛谷丢掉 str2[] 与 = 之间的空格;官方 PDF 第 1 页为 char str2[] ={'H','e','l','l','0'};。已按列位重建恢复。","locus":"stemMd","nature":"source_alteration","expected":"char str2[] ={'H','e','l','l','0'};","verbatim":"char str2[] ={'H','e','l','l','0'};","confirmedBy":"both","originalCheck":"restored_from_original"},{"kind":"layout","note":"洛谷把选项 B 的两行代码压成一行行内代码;官方 PDF 第 1 页是带行号的代码清单。已恢复为代码围栏。","locus":"options[1].textMd","nature":"source_alteration","expected":"cout\u003c\u003cstr1\u003c\u003cendl;","verbatim":"cout\u003c\u003cstr1\u003c\u003cendl;","confirmedBy":"both","originalCheck":"restored_from_original"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-03-sc-03","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.125Z","guideFor":null,"challengePassed":null},{"id":"8f00612b-daba-4f6c-b570-f8ea674446c0","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-03-sc-10","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":36,"payload":{"stem":"执行以下 C++ 代码后,`sub` 的值是()。\n\n```cpp\nstring str = \"GESP2026\";\nstring sub = str.substr(4, 2);\n```","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":3,"points":2,"sha256":"16be70a6edb8b7947285995bb18f0dd5c3c118113b14ae34c6c08da35984defe","fileUrl":"https://gesp.ccf.org.cn/101/attach/1734775052173344.pdf","paperId":"gesp-cpp-l3-2026-03","section":"single_choice","language":"C++","authority":"official","questionNo":10},"options":[{"id":"A","text":"$20$"},{"id":"B","text":"$02$"},{"id":"C","text":"$2026$"},{"id":"D","text":"$026$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-03-sc-10","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.127Z","guideFor":null,"challengePassed":null},{"id":"cb7ac12c-3ae0-4c66-b67f-724d5682e2f0","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-03-sc-12","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":37,"payload":{"stem":"执行以下代码后,输出结果是:( )。\n\n```cpp\nchar s[10] = \"abcde\";\nint a = sizeof(s) / sizeof(s[0]);\nint b = strlen(s);\ncout \u003c\u003c a - b;\n```","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":3,"points":2,"sha256":"16be70a6edb8b7947285995bb18f0dd5c3c118113b14ae34c6c08da35984defe","fileUrl":"https://gesp.ccf.org.cn/101/attach/1734775052173344.pdf","paperId":"gesp-cpp-l3-2026-03","section":"single_choice","language":"C++","authority":"official","questionNo":12},"options":[{"id":"A","text":"$4$"},{"id":"B","text":"$5$"},{"id":"C","text":"$6$"},{"id":"D","text":"$10$"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-03-sc-12","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.129Z","guideFor":null,"challengePassed":null},{"id":"88bbf254-49f9-4c2c-86b7-1fe8dc0812bb","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-03-tf-08","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":38,"payload":{"stem":"由于在 $0 \\sim 255$ 范围内,`char` 类型和 `int` 类型可以互换,因此在这里 x 和 y 相等。\n \n```cpp\nchar x='1';\nint y=1;\n```","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":3,"points":2,"sha256":"16be70a6edb8b7947285995bb18f0dd5c3c118113b14ae34c6c08da35984defe","fileUrl":"https://gesp.ccf.org.cn/101/attach/1734775052173344.pdf","paperId":"gesp-cpp-l3-2026-03","section":"true_false","language":"C++","authority":"official","questionNo":8},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-03-tf-08","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.131Z","guideFor":null,"challengePassed":null},{"id":"31e6261f-b02b-47b5-97bc-1282257cba59","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-06-sc-07","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":39,"payload":{"stem":"关于字符串和字符数组,下列说法正确的是( )。","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":6,"points":2,"sha256":"7d6596448d55cbe5af37bb6b0d3aea00b14af9988e5519f0bb54da1299e0c72b","fileUrl":"https://gesp.ccf.org.cn/101/attach/1753295297183776.pdf","paperId":"gesp-cpp-l3-2026-06","section":"single_choice","language":"C++","authority":"official","questionNo":7},"options":[{"id":"A","text":"```cpp\nchar str[] = \"GESP\";\nint len1 = sizeof(str);\nint len2 = strlen(str);\n```\n上面程序能够正确执行,`len1` 与 `len2` 相等。"},{"id":"B","text":"```cpp\nchar str1[4] = \"GESP\";\nchar str2[4] = {'G', 'E', 'S', 'P'};\n```\n这段程序将能够正确执行。"},{"id":"C","text":"```cpp\nchar str2[4] = {'G', 'E', 'S', 'P'};\nstrcpy(str2, \"HELLO,GESP\");\ncout \u003c\u003c str2 \u003c\u003c endl;\n```\n这段程序即使能够运行,但是存在覆盖数组以外的内存空间的行为,可能会引起严重错误。"},{"id":"D","text":"```cpp\nchar dest[4] = {'G', 'E', 'S', 'P'};\nchar src[] = \"HELLO\";\nstrcat(dest, src);\ncout \u003c\u003c dest \u003c\u003c endl;\n```\n这段程序能够正确执行,不存在数组越界行为。"}],"textFidelity":[{"kind":"layout","note":"洛谷把原卷第 2 页选项 A–D 的多行代码清单压成一行;已按 PDF 字形列位重建恢复为代码围栏(装订线行号不入正文)。","locus":"options[0].textMd","nature":"source_alteration","expected":"`char str[] = \"GESP\"; int len1 = sizeof(str); int len2 = strlen(str);` 上面程序能够正确执行,`len1` 与 `len2` 相等。","verbatim":"char str[] = \"GESP\";","confirmedBy":"both","originalCheck":"restored_from_original"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-06-sc-07","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.134Z","guideFor":null,"challengePassed":null},{"id":"6a30400c-ed33-452b-9048-8212faf89a3a","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-06-sc-13","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":40,"payload":{"stem":"关于 `string` 的成员函数,下面说法错误的是( )。","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":6,"points":2,"sha256":"7d6596448d55cbe5af37bb6b0d3aea00b14af9988e5519f0bb54da1299e0c72b","fileUrl":"https://gesp.ccf.org.cn/101/attach/1753295297183776.pdf","paperId":"gesp-cpp-l3-2026-06","section":"single_choice","language":"C++","authority":"official","questionNo":13},"options":[{"id":"A","text":"`size()`:返回字符串长度(字符个数,不含 `'\\0'`)。"},{"id":"B","text":"`length()` 与 `size()` 功能完全一致,返回字符串长度。"},{"id":"C","text":"`empty()`:判断字符串是否为空(非空返回 `true`,空返回 `false`)。"},{"id":"D","text":"`s.append(s2, 0, 3);` 从 `s2` 下标 $0$ 开始,截取 $3$ 个字符。"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-06-sc-13","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.136Z","guideFor":null,"challengePassed":null},{"id":"df7a090a-d330-4c9d-8a53-5d38777ff0c6","sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics#gesp-cpp-l3-2026-06-tf-10","articleId":"8d015f22-c18b-496f-b1a2-5afc26337cdc","type":"quiz_choice","order":41,"payload":{"stem":"判断一个 `int` 型数字 `s[i]` 是不是在 $0$ 和 $9$ 之间(可以是 $0$ 和 $9$),判断条件可以写为 `if (s[i] >= '0' && s[i] \u003c= '9')`。","multi":false,"source":{"exam":"GESP","year":2026,"level":3,"month":6,"points":2,"sha256":"7d6596448d55cbe5af37bb6b0d3aea00b14af9988e5519f0bb54da1299e0c72b","fileUrl":"https://gesp.ccf.org.cn/101/attach/1753295297183776.pdf","paperId":"gesp-cpp-l3-2026-06","section":"true_false","language":"C++","authority":"official","questionNo":10},"options":[{"id":"true","text":"√(正确)"},{"id":"false","text":"×(错误)"}]},"outcomeRules":[{"when":"on_graded","score":{"from":"submission_score"},"outcomeId":"9fc6ef57-b23b-4010-96c5-5d3cd4ea5d90"}],"questionId":"gesp-cpp-l3-2026-06-tf-10","guideForCardId":null,"createdAt":"2026-09-05T00:45:39.429Z","updatedAt":"2026-09-05T02:36:29.139Z","guideFor":null,"challengePassed":null}],"isOwner":false,"canViewTeacherEdition":false,"sourceKey":"gesp-cpp-l3/l3.string/l3.string.basics"},"course":{"id":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","sourceKey":"gesp-cpp-l3","ownerId":"46d3dc3e-1a5c-4353-b8f5-c701c912fb9c","title":"GESP C++ 三级","description":"掌握计算机中常用进位制、位运算及数据编码的知识,掌握一维数组、字符串类型及其函数的使用,掌握枚举法、模拟法的原理和运用技巧,对于较简单的实际问题能构造算法、描述算法、实现算法并调试程序。\n\n本课程以官方真题为主体:每篇文章 = 一个知识点(介绍 + 该知识点下的历年真题),另设「历年真题卷」单元供模拟考。知识点体系取自 CCF 编程能力等级认证标准(C++ 三级)。","coverUrl":null,"coverFocalX":50,"coverFocalY":50,"coverScale":1,"status":"published","visibility":"listed","createdAt":"2026-08-15T09:20:04.916Z","updatedAt":"2026-09-05T00:45:39.270Z","units":[{"id":"8627aa36-9eb3-4626-a139-5ffe7c564162","sourceKey":"gesp-cpp-l3/l3.encoding","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"数据编码","order":0,"createdAt":"2026-09-05T00:45:39.276Z","updatedAt":"2026-09-05T00:45:39.276Z","articles":[{"id":"3ab71919-c70b-4de0-bad7-e7b728192665","title":"原码、反码、补码","summary":"了解二进制数据编码:原码、反码、补码。","order":0}]},{"id":"ec61de15-2392-490b-9c8a-96801d2bba2f","sourceKey":"gesp-cpp-l3/l3.radix","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"进制转换","order":1,"createdAt":"2026-09-05T00:45:39.281Z","updatedAt":"2026-09-05T00:45:39.281Z","articles":[{"id":"b23ac358-d1a3-4f7b-b0a5-e437c9aa54f5","title":"二进制与十进制互转","summary":"掌握数据的进制转换:二进制、十进制。","order":0},{"id":"db7a85e9-e3bc-4f95-ae2e-5534981135a3","title":"八进制与十六进制转换","summary":"掌握数据的进制转换:八进制、十六进制。","order":1}]},{"id":"4b8b8a5f-64a0-4595-9791-5e6fc55b3a23","sourceKey":"gesp-cpp-l3/l3.bitwise","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"位运算","order":2,"createdAt":"2026-09-05T00:45:39.287Z","updatedAt":"2026-09-05T00:45:39.287Z","articles":[{"id":"38af6022-6a18-410f-9878-31a1988a558f","title":"位运算:与(&)、或(|)、非(~)","summary":"掌握位运算:与(&)、或(|)、非(~)的基本使用方法及原理。","order":0},{"id":"30b8d6b8-ae02-405e-8887-297f81b23abb","title":"位运算:异或(^)","summary":"掌握位运算:异或(^)的基本使用方法及原理。","order":1},{"id":"a0fdf9bf-5064-4844-9723-fcc505e1eb30","title":"位运算:左移(\u003c\u003c)与右移(>>)","summary":"掌握位运算:左移(\u003c\u003c)、右移(>>)的基本使用方法及原理。","order":2}]},{"id":"58a101fa-1da5-4ce8-be54-416f798ac3a4","sourceKey":"gesp-cpp-l3/l3.algorithm","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"算法与描述","order":3,"createdAt":"2026-09-05T00:45:39.296Z","updatedAt":"2026-09-05T00:45:39.296Z","articles":[{"id":"9686f942-947d-410b-b77c-621f2c712e77","title":"算法的概念","summary":"了解算法的概念与描述。","order":0},{"id":"d8784643-141f-4100-a435-52f01744d0b2","title":"算法的三种描述方式","summary":"熟练运用自然语言、流程图、伪代码方式来描述算法。","order":1},{"id":"e6d644d8-d64d-464e-afd4-4273246f331f","title":"枚举法","summary":"理解枚举算法的原理及特点,可以解决实际问题。","order":2},{"id":"d79f4c3a-3271-4ac7-8640-9ceae76fda59","title":"模拟法","summary":"理解模拟算法的原理及特点,可以解决实际问题。","order":3}]},{"id":"ba0e775e-c669-4faf-9569-fd939b273767","sourceKey":"gesp-cpp-l3/l3.array","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"一维数组","order":4,"createdAt":"2026-09-05T00:45:39.305Z","updatedAt":"2026-09-05T00:45:39.305Z","articles":[{"id":"3ced4892-0d2e-4125-81fb-ba090a77f2e6","title":"一维数组的定义与访问","summary":"C++一维数组基本应用(不包括变长数组):数组定义、初始化与元素访问。","order":0},{"id":"43578758-4e65-4d01-8455-8409703eeb5c","title":"一维数组的基本应用","summary":"C++一维数组基本应用(不包括变长数组):遍历、统计、查找、计数等常见应用。","order":1}]},{"id":"9adbf03e-f5dd-4ebb-b216-998d64c32a53","sourceKey":"gesp-cpp-l3/l3.string","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"字符串及其函数","order":5,"createdAt":"2026-09-05T00:45:39.310Z","updatedAt":"2026-09-05T00:45:39.310Z","articles":[{"id":"8d015f22-c18b-496f-b1a2-5afc26337cdc","title":"字符串的表示与基本操作","summary":"掌握字符串及其函数的使用(字符串的定义、输入输出、长度与下标访问)。","order":0},{"id":"8515caab-ce76-4eb8-9953-7da169fd02f8","title":"字符串大小写转换","summary":"掌握字符串函数的使用:大小写转换。","order":1},{"id":"96937e7e-1282-4b59-8fd4-161e2c0908bc","title":"字符串搜索","summary":"掌握字符串函数的使用:字符串搜索。","order":2},{"id":"7213a6d3-846e-4202-a95b-1c0aee7ef3ef","title":"字符串分割与替换","summary":"掌握字符串函数的使用:分割、替换。","order":3}]},{"id":"e475090c-276a-4ebf-b7e1-47b5693e98b2","sourceKey":"gesp-cpp-l3/papers","courseId":"2c3c4c15-d5a7-44ee-b00c-8e02408e387c","title":"历年真题卷","order":6,"createdAt":"2026-09-05T00:45:39.318Z","updatedAt":"2026-09-05T00:45:39.318Z","articles":[{"id":"32357816-919f-4a17-8937-1f78ff8296b0","title":"GESP 6月认证C++三级真题","summary":"2023年6月 · 3 个分区 · 27 道题","order":0},{"id":"e35cec4b-a0ca-4d8b-b26d-692f4f3e8182","title":"GESP 9月认证C++三级真题","summary":"2023年9月 · 3 个分区 · 27 道题","order":1},{"id":"43ab401f-4e9b-4964-ba23-91da15d46897","title":"GESP 12月认证C++三级真题","summary":"2023年12月 · 3 个分区 · 27 道题","order":2},{"id":"b68bd243-d214-42ed-b4c4-3b15d90b6e10","title":"GESP 3月认证C++三级真题","summary":"2024年3月 · 3 个分区 · 27 道题","order":3},{"id":"b68f5b75-448a-4339-85e0-4d6649e3d815","title":"GESP 6月认证 C++ 三级真题","summary":"2024年6月 · 3 个分区 · 27 道题","order":4},{"id":"72e54b49-4377-46c4-81f0-2eef83f7157e","title":"GESP 9月认证 C++ 三级真题","summary":"2024年9月 · 3 个分区 · 27 道题","order":5},{"id":"83b0934e-e690-46ce-ad10-4fc5a585c53c","title":"GESP 2024年12月认证 C++ 3级真题","summary":"2024年12月 · 3 个分区 · 27 道题","order":6},{"id":"40a4859f-8c3b-42b0-aca3-5de3d92d9572","title":"CCF GESP 2025年3月认证 C++ 3级试题","summary":"2025年3月 · 3 个分区 · 27 道题","order":7},{"id":"b510a6f3-ba88-4eb7-aa18-123a2febfd8b","title":"CCF GESP 2025年6月认证 C++ 3级试题","summary":"2025年6月 · 3 个分区 · 27 道题","order":8},{"id":"557ec007-9a59-4c49-8b40-13833bb5584d","title":"CCF GESP 2025年9月认证 C++ 3级试题","summary":"2025年9月 · 3 个分区 · 27 道题","order":9},{"id":"2b3f7d2a-d47c-41e6-bdd1-45d002cc8e72","title":"CCF GESP 2025年12月认证 C++ 3级试题","summary":"2025年12月 · 3 个分区 · 27 道题","order":10},{"id":"97cb105c-0d4d-47fd-9c95-950670bfcc73","title":"CCF GESP 2026年3月认证 C++ 3级试题","summary":"2026年3月 · 3 个分区 · 27 道题","order":11},{"id":"1553b5fe-e105-48af-93b3-05590b80ed8c","title":"CCF GESP 2026年6月认证 C++ 3级试题","summary":"2026年6月 · 3 个分区 · 27 道题","order":12}]}],"owner":{"displayName":"李富荣"},"enrollment":null,"articleProgress":{},"isOwner":false,"outcomeCount":22},"user":null}
传习Chuanxi