Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
2
200050056-200050102-git
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kajal
200050056-200050102-git
Commits
c57125b9
Commit
c57125b9
authored
Aug 07, 2021
by
khy724
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: The Better Idea
parent
8eca7243
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
11 deletions
+75
-11
a.exe
a.exe
+0
-0
main.cpp
main.cpp
+4
-3
passwords.h
passwords.h
+65
-4
passwords.h.gch
passwords.h.gch
+0
-0
utils.h
utils.h
+6
-4
utils.h.gch
utils.h.gch
+0
-0
No files found.
a.exe
0 → 100644
View file @
c57125b9
File added
main.cpp
View file @
c57125b9
#include<iostream>
#include <iostream>
#include"utils.h"
#include "utils.h"
#include <string>
using
namespace
std
;
using
namespace
std
;
int
main
()
{
int
main
()
{
char
*
nm
,
pwd
;
string
nm
,
pwd
;
cout
<<
"Enter your name"
<<
endl
;
cout
<<
"Enter your name"
<<
endl
;
cin
>>
nm
;
cin
>>
nm
;
cout
<<
"Enter your password"
<<
endl
;
cout
<<
"Enter your password"
<<
endl
;
...
...
passwords.h
View file @
c57125b9
...
@@ -3,10 +3,11 @@
...
@@ -3,10 +3,11 @@
#include<map>
#include<map>
#include<string>
#include<string>
#include<vector>
using
namespace
std
;
using
namespace
std
;
map
<
string
,
string
>
passwords
{
/*
map<string, string> passwords {
{"Tinsmorem","Iltil"},
{"Tinsmorem","Iltil"},
{"Ulyglet","Snurgrurg"},
{"Ulyglet","Snurgrurg"},
{"Lafibnom","Diamdioc"},
{"Lafibnom","Diamdioc"},
...
@@ -28,16 +29,76 @@ map<string, string> passwords {
...
@@ -28,16 +29,76 @@ map<string, string> passwords {
{"Fensmyl","Vrakniarth"},
{"Fensmyl","Vrakniarth"},
{"Pibkecim","Jerpuldo"}
{"Pibkecim","Jerpuldo"}
};
};
*/
map
<
string
,
int
>
userids
{
{
"Tinsmorem"
,
0
},
{
"Ulyglet"
,
1
},
{
"Lafibnom"
,
2
},
{
"Thenbovir"
,
3
},
{
"Gallnip"
,
4
},
{
"Froolvess"
,
5
},
{
"Smameknuc"
,
6
},
{
"Smedekmet"
,
7
},
{
"Cebbnec"
,
8
},
{
"Klolyddwac"
,
9
},
{
"Blivylnas"
,
10
},
{
"Glyhamdas"
,
11
},
{
"Hillnar"
,
12
},
{
"Phieddlu"
,
13
},
{
"Fnamdyn"
,
14
},
{
"Fladnivith"
,
15
},
{
"Phelnyll"
,
16
},
{
"Snallbam"
,
17
},
{
"Fensmyl"
,
18
},
{
"Pibkecim"
,
19
},
};
vector
<
string
>
passwords
{
"Iltil"
,
"Snurgrurg"
,
"Diamdioc"
,
"Oudrarrouz"
,
"Haulmi"
,
"Holdiz"
,
"Hinnyual"
,
"Traolbubrorg"
,
"Khishohi"
,
"Maennius"
,
"Jolmuulmohr"
,
"Drustiel"
,
"Nanruddiarth"
,
"Zussial"
,
"Laszo"
,
"Nathentoih"
,
"Phorughoelle"
,
"Skilzeda"
,
"Vrakniarth"
,
"Jerpuldo"
};
//Return true only if the person is present in the database
//Return true only if the person is present in the database
bool
find_user
(
string
name
){
/*
bool find_user(string name){
if(passwords.find(name) != passwords.end()) return true;
if(passwords.find(name) != passwords.end()) return true;
else return false;
else return false;
}
}
*/
//Returns the password for a particular person
//Returns the password for a particular person
string
get_password
(
string
name
){
/*
string get_password(string name){
return passwords[name];
return passwords[name];
}*/
bool
find_userid
(
string
name
){
if
(
userids
.
find
(
name
)
!=
userids
.
end
())
return
userids
[
name
];
else
return
-
1
;
}
string
get_password
(
string
name
){
int
user_id
=
-
1
;
if
((
user_id
=
find_userid
(
name
))
<
0
)
return
""
;
else
return
passwords
[
user_id
];
}
}
#endif
#endif
passwords.h.gch
0 → 100644
View file @
c57125b9
File added
utils.h
View file @
c57125b9
#include<iostream>
#include<iostream>
#include"password.h"
#include "passwords.h"
#include<string>
#include<vector>
using
namespace
std
;
using
namespace
std
;
map
<
strings
,
strings
>
passwords
;
//vector<string,string
> passwords;
bool
login
(
string
name
,
string
password
)
{
bool
login
(
string
name
,
string
password
)
{
if
(
passwords
.
find
(
name
)
!=
passwords
.
end
()
&&
passwords
[
name
]
==
password
)
return
true
;
if
(
get_password
(
name
)
==
password
)
return
true
;
else
return
false
;
else
return
false
;
}
}
utils.h.gch
0 → 100644
View file @
c57125b9
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment