摘要

题目链接 难度等级 完成状态 完成分数 最后编辑时间 失误原因(初次提交分数)
Password Check ★☆☆☆☆ 答案正确 100 2015-02-24 12:05:51 return 0没写(3)

题意

判断密码强度。

题解

按照题目要求做就好了。简单模拟。

代码

411A.cpp代码已折叠
展开折叠内容
显示/移除行号
  1. #include<cstdio>
  2. #include<iostream>
  3. #include<string>
  4. using namespace std;
  5. #define dsi(n) int n;scanf("%d",&n)
  6. #define si(n) scanf("%d",&n)
  7. #define f(i,n) for(int i=1;i<=n;++i)
  8. #define fi(n) f(i,n)
  9. #define f0(i,n) for(int i=0;i!=n;++i)
  10. #define fd(i,n) for(int i=n;i>=1;--i)
  11. #define ci const int&
  12. #define c(x) const x&
  13. class st
  14. {
  15. int x,y;
  16. friend bool operator <(const st&a,const st&b){return a.x<b.x;}
  17. };
  18. bool p(string s)
  19. {
  20. bool o1=0,o2=0,o3=0;
  21. if(s.size()<5)return 0;//fixed:<不是<=//
  22. for(int i=0;i<=s.size()-1;++i)
  23. {
  24. if('a'<=s[i]&&s[i]<='z')o1=1;
  25. if('A'<=s[i]&&s[i]<='Z')o2=1;
  26. if('0'<=s[i]&&s[i]<='9')o3=1;
  27. }
  28. if(o1&&o2&&o3)return 1;
  29. return 0;//fixed:记住return 0//
  30. }
  31. int main()
  32. {
  33. string s;
  34. cin>>s;
  35. cout<<(p(s)?"Correct":"Too weak");
  36. return 0;
  37. }

著作权声明[编辑]

关于[编辑]