(以“分类:字符串处理 ==摘要== {{信息题|Password Check|http://acm.hust.edu.cn/vjudge/contest/view.action?cid{{=}}70594#problem/A|1|100|time=2015-02-24 12:0...”为内容创建页面) |
小 (补充错误原因) |
||
| 第1行: | 第1行: | ||
[[分类:字符串处理]] | [[分类:字符串处理]] | ||
==摘要== | ==摘要== | ||
| − | {{信息题|Password Check|http://acm.hust.edu.cn/vjudge/contest/view.action?cid{{=}}70594#problem/A|1|100|time=2015-02-24 12:05:51}} | + | {{信息题|Password Check|http://acm.hust.edu.cn/vjudge/contest/view.action?cid{{=}}70594#problem/A|1|100|return 0没写|3|time=2015-02-24 12:05:51}} |
*来自寒假练习:[http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70594 2015 Winter Warm up div2] A题 | *来自寒假练习:[http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70594 2015 Winter Warm up div2] A题 | ||
*原题链接:http://codeforces.com/problemset/problem/411/A | *原题链接:http://codeforces.com/problemset/problem/411/A | ||
| 题目链接 | 难度等级 | 完成状态 | 完成分数 | 最后编辑时间 | 失误原因(初次提交分数) |
|---|---|---|---|---|---|
| Password Check | ★☆☆☆☆ | 答案正确 | 100 | 2015-02-24 12:05:51 | return 0没写(3) |
判断密码强度。
按照题目要求做就好了。简单模拟。
| 411A.cpp代码已折叠
展开折叠内容
|
|---|
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
#define dsi(n) int n;scanf("%d",&n)
#define si(n) scanf("%d",&n)
#define f(i,n) for(int i=1;i<=n;++i)
#define fi(n) f(i,n)
#define f0(i,n) for(int i=0;i!=n;++i)
#define fd(i,n) for(int i=n;i>=1;--i)
#define ci const int&
#define c(x) const x&
class st
{
int x,y;
friend bool operator <(const st&a,const st&b){return a.x<b.x;}
};
bool p(string s)
{
bool o1=0,o2=0,o3=0;
if(s.size()<5)return 0;//fixed:<不是<=//
for(int i=0;i<=s.size()-1;++i)
{
if('a'<=s[i]&&s[i]<='z')o1=1;
if('A'<=s[i]&&s[i]<='Z')o2=1;
if('0'<=s[i]&&s[i]<='9')o3=1;
}
if(o1&&o2&&o3)return 1;
return 0;//fixed:记住return 0//
}
int main()
{
string s;
cin>>s;
cout<<(p(s)?"Correct":"Too weak");
return 0;
}
|