char passwd[50];
std::cin >> passwd;
If(passwd == "the actual pass"){
std::cout << "Access Granted”;
} else {
std::cout << "Access Denied";
}
int blabla; cout << "This is a random line"; cin >> blabla;
#include <iostream>
#include <Windows.h>
using namespace std;
int main()
{
char passwd[50];
cin >> passwd;
if(passwd == "kana"){
cout << "Access Granted";
}else{
cout << "Access Denied";
}
}

if(!strcmp(passwd, "kana") // strcmp returns 0 if both strings are the same
{
//code
}
if(std::string(passwd).Compare("kana"))
{
}
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
string passwd;
cin >> passwd;
if(passwd == "kana"){
cout << "Access Granted";
}else{
cout << "Access Denied";
}
}
#include <iostream>
#include <string>
using namespace std;
int main(){
string acc, pw;
cout << "Username: \n";
cin >> acc;
cout << "Password: \n";
cin >> pw;
if(acc == "MPGH"){
cout << "Username correct\n\n";
}
else if(acc != "MPGH"){
cout << "Username incorrect\n\n";
}
if(pw == "cplusplus"){
cout << "Password correct\n\n";
}
else if(pw != "cplusplus"){
cout << "Password incorrect\n\n";
}
if(acc != "MPGH" && pw != "cplusplus"){
cout << "Username or/and password incorrect, are you sure you got the valid info?" << endl << "contact me for the password and username\n" << endl;
}
else if(acc == "MPGH" && pw == "cplusplus"){
cout << "Information correct. Press any key to see your code." << endl;
system("pause");
cout << endl;
cout << "Code : gHahwsejGKfndfj6893860339gDhbJeGhtdhzxvnG" << endl << "paste this on the forum\n\n";
}
system("pause");
}
#include<iostream>
#include<cstdlib>// to add Pauses, if u don't want them then erase em.
#include<string>
#include<windows.h>//I think u need this to erase everyting on the screen. //don't remember
using namespace std; // so u can just write cout instead of std::cout
int main()
{
string username = "Guest"; // declare a string variable and initialize it.
string password = "MPGH";
string userInput1;
string userInput2;
int security;
// a string variable holds letters. Which in this case it's what you want
cout << "username: ";
cin >> userInput1;
system("CLS"); // erases everything on the screen.
cout << "Password: ";
cin >> userInput2;
if(userInput1 == username)
{
security = 5;
if(userInput 2 == password)
{
security = security + 5;
}
}
else
{
security = 0;
}
if(security == 10)
{
cout << "Welcome guest!\n\n";
}
if(security == 5)
{
cout << "incorrect password or username. Shutting down.\n";
system("PAUSE");
return 0;
}
if(security == 0)
{
cout << "error Shutting down\n\n";
system("PAUSE");
return 0;
}
system("PAUSE");
return 0;
}
#include < blah blah my hearder>
using namespace std;
int main()
{
cout << "Hello my first message in output";
// output ( message )
cin >> inicial >> final >> razao;
// input ( when the person enter something into the screen)
}