CE了求大佬看看

B3843 [GESP202306 三级] 密码合规

hzjack @ 2023-12-06 20:06:29

include<bits/stdc++.h>

using namespace std; int main(){ string s,s1,fs="!@#$"; cin>>s; int n,l,u,f,o; for(int i=0;i<s.size();i++){ if(s[i]==',') s[i]==' '; } istringstream cins(s); while(cin>>s1){ if(s1.size()<6||s1.size()>12) continue; n=0,l=0,u=0,f=0,o=0; for(int i=0;i<s.size();i++){ if(isdigit(s1[i])) n=1; else if(islower(s1[i])) l=1; else if(isupper(s1[i])) u=1; else if(fs.find(s1[i])!=-1) fh=1; else{ other=1; break; } } if(!o&&l+n+u>=2&&fh){ cout<<s1<<endl; } } return 0; }```c


by hzjack @ 2023-12-06 20:09:53

#include<bits/stdc++.h>
using namespace std;
int main(){ 
  string s,s1,fs="!@#$"; 
  cin>>s; 
  int n,l,u,f,o; 
  for(int i=0;i<s.size();i++){ if(s[i]==',') s[i]==' '; } 
  istringstream cins(s);
  while(cin>>s1){ 
    if(s1.size()<6||s1.size()>12) continue; n=0,l=0,u=0,f=0,o=0;
        for(int i=0;i<s.size();i++){
          if(isdigit(s1[i])) n=1; 
      else if(islower(s1[i])) l=1; 
          else if(isupper(s1[i])) u=1;
          else if(fs.find(s1[i])!=-1) fh=1; 
          else{ other=1; break; } 
        }           
    if(!o&&l+n+u>=2&&fh){
          cout<<s1<<endl; 
    } 
  }
  return 0;
}```c

by wanglexi @ 2023-12-06 20:12:23

18 | else if(fs.find(s1[i])!=-1) fh=1;

fh 没有定义

19 | else{ other=1; break; }

other 没有定义

21 | if(!o&&l+n+u>=2&&fh){

fh 没有定义


by heyx0201 @ 2023-12-06 20:29:11

@hzjack Line 18 的 fh 是什么??? Line 19 的 other 是什么???


by heyx0201 @ 2023-12-06 20:29:34

@hzjack 能不能自己好好看看再来发帖


by heyx0201 @ 2023-12-06 20:30:02

还有 Line 21 的 fh


by heyx0201 @ 2023-12-06 20:32:24

@qym110809 15 16 哪有错


by qym110809 @ 2023-12-06 20:33:33

@heyx0201 6,我这是15,16,18


by wanglexi @ 2023-12-06 20:34:10

15的fh,16的other,以及18的fh @hzjack


by heyx0201 @ 2023-12-06 20:43:26

@qym110809 sorry 数错了


by heyx0201 @ 2023-12-06 20:43:49

@qym110809 反正有 3 个错


|