online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<iostream> #include<string> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<time.h> #define MAXLENGTH 25 using namespace std; /*This program is made by Arslan K Q. This Program's name is "AKQ HACKING PROGRAM". Please make sure that you input the correct information, if there was a mistake while entering the data (Human Error), please restart (Run) the Program again.*/ int msleep(unsigned long milisec) { struct timespec req={0}; time_t sec=(int)(milisec/1000); milisec=milisec-(sec*1000); req.tv_sec=sec; req.tv_nsec=milisec*1000000L; while(nanosleep(&req,&req)==-1) continue; return 1; } int main() { cout<<"Press any Key to Start\n"; getch(); system("cls");//system("clear"); cout<<"Program starting in...\n"; for(int n=10; n>0; n--) { cout<<n<<" \n"; msleep(1000); } system("cls");//system("clear"); cout<<"Program started!!!\n"<<"\n"; msleep(1000); cout<<"Program made by Arslan K Q\n"; cout<<" \n"; msleep(2500); guidea: int guide; cout<<"Do you want to Skip the Guide: \n[1] Yes\n[2] No\n"; guide: cin>>guide; if(guide==1) { //Skip Yes msleep(2000); int guide1; cout<<"Are you sure that you want to Skip the the Guide\n[1] Yes\n[2] No\n"; guide1: cin>>guide1; if(guide1==1) { //Skip Yes Yes msleep(2000); goto program; } else if(guide1==2) { //Skip Yes No msleep(2000); system("cls");//system("clear"); goto guidea; } else { //Wrong option msleep(2000); cout<<"Not valid choice. Please choose option: [1] to Skip the Guide, [2] to view the Guide: "; msleep(2000); goto guide1; } } else if(guide==2) { //Skip No msleep(2000); int guide2; cout<<"Are you sure that you don't want to Skip the the Guide\n[1] Yes\n[2] No\n"; guide2: cin>>guide2; if(guide2==1) { //Skip No Yes msleep(2000); cout<<"PLEASE NOTE: Please make sure that you input the correct information,\n"; msleep(3500); cout<<"if there was a mistake while entering the data (Human Error), please restart (Run) the Program again.\n"; msleep(5000); cout<<"After Entering the Data, press 'Enter' and wait for the next step to Execute...\n"; msleep(4500); cout<<"For further Information Please contact Arslan K Q...\n"; msleep(2000); goto program; } else if(guide2==2) { //Skip No No msleep(2000); system("cls");//system("clear"); goto guidea; } else { //Wrong option msleep(2000); cout<<"Not valid choice. Please choose option: [1] to Skip the Guide, [2] to view the Guide: "; msleep(2000); goto guide2; } } else { //Wrong option msleep(2000); cout<<"Not valid choice. Please choose option: [1] to Skip the Guide, [2] to view the Guide: "; msleep(2000); goto guide; } program: cout<<" \n"; cout<<"Please choose an option to continue...\n"; cout<<" \n"; msleep(3500); choose: int num; cout<<"Would you like to:\n[1] Login\n[2] Register\n[3] Continue to the Program\n[4] Exit\n"; here: cin>>num; if(num==1) { //LOGIN int loginchoice; msleep(2000); cout<<"Are you sure that you want to Login\n[1] Yes\n[2] No\n"; retry: cin>>loginchoice; if(loginchoice==1) { msleep(2500); string usernamel; cout<<"Please enter your Username: "; cin>>usernamel; msleep(2000); string userpasswordl; cout<<"Please enter your Password: "; cin>>userpasswordl; system("cls");//system("clear"); if(usernamel=="arslankq29"&&userpasswordl=="akq2932002akq") { msleep(2000); cout<<"Welcome Master!!! Arslan K Q\n"; goto end; } else { msleep(2000); cout<<"Error!!! Login is not correct. Please Re Run the Program.\n"<<'\n'; goto end; } } else if(loginchoice==2) { msleep(2000); system("cls");//system("clear"); goto choose; } else { msleep(2000); cout<<"Wrong confirmation. Please choose [1] for Yes or [2] for No: "; goto retry; } } else if(num==2) { //REGISTER int registerchoice; msleep(2000); cout<<"Are you sure that you want to Register\n[1] Yes\n[2] No\n"; retry2: cin>>registerchoice; if(registerchoice==1) { msleep(2000); reg: string usernamel; cout<<"Please enter your Username: "; cin>>usernamel; msleep(2000); int confirmation; cout<<"Username- "<<usernamel<<"\n"<<"Confirm?\n"<<"[1] Yes\n"<<"[2] No\n"; con: cin>>confirmation; cin.ignore(); if(confirmation==1) { if(usernamel=="arslankq29") { msleep(2000); cout<<"Sorry this Username is already taken, please choose another Username\n"; msleep(5000); system("cls");//system("clear"); goto reg; } else { msleep(2000); passtry: cout<<"Please enter the password: "; char password[MAXLENGTH]; int i=0; char a; for(i=0;i<MAXLENGTH;) { a=getch(); if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||(a>='0'&&a<='9')) { password[i]=a; cout<<"*"; ++i; } if(a=='\b'&&i>=1) { cout<<"\b \b"; --i; } if((a=='\r')||(a=='\n')) { password[i]='\0'; break; } } system("cls");//system("clear"); cout<<"Please enter your password again: "; char password2[MAXLENGTH]; for(i=0;i<MAXLENGTH;) { a=getch(); if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||(a>='0'&&a<='9')) { password2[i]=a; ++i; cout<<"*"; } if(a=='\b'&&i>=1) { cout<<"\b \b"; --i; } if((a=='\r')||(a=='\n')) { password2[i]='\0'; break; } } system("cls");//system("clear"); int p=0; for(i=0; password[i]!='\0'; i++) { if(password[i]!=password2[i]) { p++; break; } } if(p==0) { msleep(2000); cout<<"TEST"; goto end; } else { msleep(2000); cout<<"Sorry Password don't match. Please Try again\n"; goto passtry; } } } else if(confirmation==2) { msleep(2000); cout<<"Sorry invalid input, Please try again.\n"; goto reg; } else { msleep(2000); cout<<"Wrong confirmation. Please choose [1] for Yes or [2] for No: "; goto con; } } else if(registerchoice==2) { msleep(2000); system("cls");//system("clear"); goto choose; } else { msleep(2000); cout<<"Wrong confirmation. Please choose [1] for Yes or [2] for No: "; goto retry; } } else if(num==3) { //Continue to the Program int programchoice; msleep(2000); cout<<"Are you sure that you want to Continue to the Program\n[1] Yes\n[2] No\n"; retry3: cin>>programchoice; if(programchoice==1) { msleep(2000); cout<<"Continuing to the Program, Please wait...\n"; msleep(2000); cin.ignore(); string name; cout<<"What is your Name: "; getline(cin,name); msleep(2500); if(name=="Arslan K Q") { string username; cout<<"Please enter your Username: "; cin>>username; msleep(2000); string userpassword; cout<<"Please enter your Password: "; cin>>userpassword; system("cls");//system("clear"); if(username=="arslankq29"&&userpassword=="akq2932002akq") { cout<<"Welcome Master!!! Arslan K Q\n"; goto end; } else { msleep(2000); cout<<"Error!!! Login is not correct. Please Re Run the Program.\n"<<'\n'; goto end; } } else { cout<<"Hello "<<name<<"!!!\n"; msleep(2500); int loginAttempta=0; while(loginAttempta<5) { string emaila; cout<<name<<","<<" Please enter your Email ID: "; cin>>emaila; string emailb; cout<<name<<","<<" Please enter your Email ID again: "; cin>>emailb; if(emaila==emailb) { msleep(2500); cout<<"Email successful!!!\n"; msleep(2500); cout<<"Please Wait...\n"; msleep(2500); int loginAttemptb=0; cin.ignore(); while(loginAttemptb<5) { std::cout<<name<<","<<" Please enter your Password: "; char passworda[MAXLENGTH]; int i=0; char a; for(i=0;i<MAXLENGTH;) { a=getch(); if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||(a>='0'&&a<='9')) { passworda[i]=a; cout<<"*"; ++i; } if(a=='\b'&&i>=1) { cout<<"\b \b"; --i; } if((a=='\r')||(a=='\n')) { passworda[i]='\0'; break; } } system("cls");//system("clear"); std::cout<<name<<","<<" Please enter your Password again: "; char passwordb[MAXLENGTH]; for(i=0;i<MAXLENGTH;) { a=getch(); if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||(a>='0'&&a<='9')) { passwordb[i]=a; ++i; cout<<"*"; } if(a=='\b'&&i>=1) { cout<<"\b \b"; --i; } if((a=='\r')||(a=='\n')) { passwordb[i]='\0'; break; } } system("cls");//system("clear"); int p=0; for(i=0; passworda[i]!='\0'; i++) { if(passworda[i]!=passwordb[i]) { p++; break; } } if(p==0) { msleep(2500); cout<<"Password successful...\n"; msleep(2500); cout<<"Loading...\n"; msleep(2500); cout<<"Please Wait...\n"; msleep(2500); std::cout<<"Welcome, "<<name<<"!!!\n"; msleep(5000); cout<<"Error!!!\n"; msleep(2500); cout<<"Warning!!!\n"; msleep(2500); cout<<"Someone is trying to hack your Account!!!\n"; msleep(2500); cout<<"Enter your Phone number to prevent hacker from hacking your Account...\n"; msleep(2500); int phonenum=0; std::cout<<"Enter your Phone number, if you don't have a Phone number, please input 29: \n"; cin>>phonenum; msleep(2500); cout<<"Success!!!\n"; msleep(2500); cout<<"Bob Johny Tom was trying to hack your Account!!!\n"; msleep(2500); int code=0; std::cout<<"Enter 2932002 to hack Bob Johny Tom's Account: \n"; code: cin>>code; if(code==2932002) { goto right; } else { msleep(2000); cout<<"The code you entered is not 2932002, please enter again: "; goto code; } right: msleep(2500); cout<<"Success!!!\n"; msleep(2500); cout<<"Bob Johny Tom's Account is [email protected], and his account's Password is: AABBCCDD\n"; msleep(2500); cout<<"Bob Johny Tom's IP address is: 23.65.698.76\n"; msleep(2500); cout<<"Don't do anything or else your Account would be hacked again...\n"; msleep(2500); cout<<"Give this device back to Arslan K Q so he could completely secure your Account...\n"; msleep(2500); cout<<"Don't do anything or else your Account would be hacked again...\n"; msleep(2500); cout<<"...\n"; for(int i=0; i<5; i++) { std::string spacea; std::cout<<" \n"; getline(std::cin, spacea); } cout<<"Your Account had been hacked...\n"; for(int i=0; i<5; i++) { std::string spaceb; std::cout<<" \n"; getline(std::cin, spaceb); } cout<<"HACKING "<<name<<"'s"<<" account in...\n"<<"\n"; for(int n=10; n>0; n--) { cout<<n<<" \n"; msleep(1000); } system("cls");//system("clear"); cout<<"HACKED!!!\n"<<"\n"; msleep(1000); cout<<"Press any Key to continue\n"; getch(); msleep(1000); system("cls");//system("clear"); msleep(1000); std::cout<<name<<"'s"<<" Account had been Hacked...\n"<<"\n"; msleep(2500); std::cout<<name<<"'s"<<" Email 1 address is: "<<emaila<<"\n"; msleep(2500); std::cout<<name<<"'s"<<" Email 2 address is: "<<emailb<<"\n"; msleep(2500); std::cout<<name<<"'s"<<" Password 1 is: "<<passworda<< "\n"; msleep(2500); std::cout<<name<<"'s"<<" Password 2 is: "<<passwordb<< "\n"; msleep(2500); std::cout<<name<<"'s"<<" Phone number is: "<<phonenum<<"\n"; msleep(2500); cout<<"Successfully hacked the Account!!!\n"; cout<<" \n"; msleep(2500); cout<<"Program made by Arslan K Q\n"; goto end; } else { msleep(2000); cout<<" \n"; cout<<"Invalid!!! Passwords don't match. Please try again.\n"<<"\n"; msleep(2000); loginAttemptb++; } } if(loginAttemptb==5) { cout<<"Too many attempts!!! The program will now terminate."; goto end; } } else { msleep(2000); cout<<" \n"; cout <<"Invalid!!! Emails don't match. Please try again.\n"<<"\n"; msleep(2000); loginAttempta++; } } if(loginAttempta==5) { cout<<"Too many attempts!!! The program will now terminate."; goto end; } } goto end; } else if(programchoice==2) { msleep(2000); system("cls");//system("clear"); goto choose; } else { msleep(2000); cout<<"Wrong confirmation. Please choose [1] for Yes or [2] for No: "; goto retry3; } } else if(num==4) { //EXIT int exitchoice; msleep(2000); cout<<"Are you sure that you want to Exit\n[1] Yes\n[2] No\n"; retry4: cin>>exitchoice; if(exitchoice==1) { msleep(2000); cout<<"Program Stopped"; msleep(2000); goto end; } else if(exitchoice==2) { msleep(2000); system("cls");//system("clear"); goto choose; } else { msleep(2000); cout<<"Wrong confirmation. Please choose [1] for Yes or [2] for No: "; goto retry4; } } else { msleep(2000); cout<<"Not valid choice. Please choose option: [1] to Login, [2] to Register, [3] to Continue to the Program, [4] to Exit: "; msleep(2000); goto here; } end: return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue