-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain.cpp
39 lines (29 loc) · 783 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <string>
using namespace std;
int main() {
string message1 = "hello world";
string message2 = "welcome";
string message3;
//Method 1 - Equal Operator
//message3 = message1;
//cout << message3 << endl;
//Method 2 - Assign Function to Copy Values
//message3.assign(message1);
//cout << message3 << endl;
//Concatenating Strings
//message3 = message1 + " " + message2;
//cout << message3 << endl;
//Length of String
//cout << message1.size() << endl;
string password;
cout << "Please type your password: ";
getline(cin, password);
if (password.size() < 6) {
cout << "The password is too short. Make sure it's at least 6 characters long." << endl;
}
else {
cout << "The password is valid. Good job!" << endl;
}
return 0;
}