Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string passwords, pass;
- getline(cin, passwords);
- while (passwords.length() != 0) {
- pass = passwords.substr(0, passwords.find(", "));
- passwords.erase(0, pass.length() + 2);
- bool isValid = true;
- if (pass.length() > 3 && pass.length() <= 16) {
- for (size_t i = 0; i < pass.length(); i++) {
- if (!isalpha(pass[i]) && !isdigit(pass[i]) && pass[i] != '-' && pass[i] != '_') {
- isValid = false;
- continue;
- }
- }
- }
- else {
- continue;
- }
- if (isValid) {
- cout << pass << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement