字符串的表示与基本操作 · 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] == '