Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdafx.h>
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string input;
- string user;
- string pass;
- cout<<"Hello, choose a number from below in order to gain access to the forum:\n\n1 - Login\n2 - Registration\n\n";
- start:
- cin >> input;
- if (input == "login" || input == "registration"|| input == "Login" || input == "Registration" || input == "1" || input == "2"){
- if (input == "1"){
- cout<<"\nYou chose to Login.\nPlease enter your username: ";
- cin >> user;
- if (user == "phillip")
- cout << "Please enter your password: ";
- else
- goto valid;
- cin >> pass;
- if (pass == "password")
- cout <<"connecting to database-\n\n";
- else
- goto valid;
- int x;
- for (x=0; x<10000; x++){
- cout << x;
- }
- cout <<"\n\nConnected! Enjoy your stay.";
- }
- else if (input == "2"){
- cout<<"\nYou chose to Register.\n\nSorry we are not accepting new members.\nYou may still choose to login if this was a mistake.";
- goto start;
- }
- else {
- cout<<"You chose " << input <<".\n\n";
- }
- }
- else{
- valid:
- cout<<"Sorry, that's not valid.\n\n";
- goto start;
- }
- cin.ignore();
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement