Skip to content

Commit

Permalink
이슈 #378에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 21, 2024
1 parent 0ed205c commit 040582f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Programmers/로그인_성공.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <string>
#include <vector>

using namespace std;

string solution(vector<string> id_pw, vector<vector<string>> db) {
bool id = false;

for (int i = 0; i < db.size(); i++) {
if (id_pw[0] == db[i][0]) {
id = true;

for (int j = 0; j < db[i].size(); j++) {
if (id_pw[1] == db[i][1]) {
return "login";
}
}
}
}

return id == true ? "wrong pw" : "fail";
}

0 comments on commit 040582f

Please sign in to comment.