PAT (Basic Level) 1067 试密码
2020-03-06 12:37
567 查看
题意
试密码,按要求输出。
思路
读入稍微注意一下,水~
代码
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); string right; int n; cin >> right >> n; cin.ignore(1); string s; int cnt = 0; while (getline(cin, s)) { if (s == "#") break; if (s == right) { cout << "Welcome in\n"; break; } cout << "Wrong password: " << s << '\n'; cnt++; if (cnt == n) { cout << "Account locked\n"; break; } } return 0; }
HINT
不定时更新更多题解,Basic Level 全部AC代码,详见 link ! ! !
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- PAT (Basic Level) Practise (中文)1067. 试密码(20)
- PAT (Basic Level) Practise (中文) 1067. 试密码(20)
- PAT (Basic Level) Practice (中文)1067 试密码(C语言)
- PAT (Basic Level) 1067 试密码
- PAT (Basic Level) Practise (中文)1067. 试密码(20) 解题报告
- PAT (Basic Level) ー1081 检查密码
- PAT (Basic Level) 1081 检查密码
- PAT (Basic Level) Practise (中文) 1076. Wifi密码 (15)
- PAT Basic 1067. 试密码(20)(C语言实现)
- PAT (Basic Level) 1076 Wifi密码
- PAT (Basic Level) 1081 检查密码
- PAT (Basic Level) Practice (中文)1081 检查密码(C语言)
- PAT(Basic Level)_1032_挖掘机技术哪家强
- PAT 乙级 (Basic Level) Practice (中文)1025
- 浙江大学PAT (Basic Level) Practice (中文)1003我要通过!JAVA代码实现及其规律分析
- PAT 乙级 (Basic Level) Practice (中文)1058
- PAT (Basic Level) Practice (中文)1066 图像过滤 (15 分)
- PAT(Basic Level)_1051_复数乘法
- PAT (Basic Level) Practice (中文)1009 说反话
- 浙大 pat Basic Level 1008