Saturday, April 15, 2017
Wednesday, February 8, 2017
write table with void in c++
#include<iostream>
#include<conio.h>
using namespace std;
void table(int a)
{
for(int i=1;i<=10;i++)
{
cout<<a<<" x "<<i<<" = "<<a*i<<endl;
}
}
int main()
{
int a;
cout<<"please enter the value: ";
cin>> a;
table(a);
getch();
return 0;
}
#include<conio.h>
using namespace std;
void table(int a)
{
for(int i=1;i<=10;i++)
{
cout<<a<<" x "<<i<<" = "<<a*i<<endl;
}
}
int main()
{
int a;
cout<<"please enter the value: ";
cin>> a;
table(a);
getch();
return 0;
}
How to Make a calculator with C++
#include <iostream>
using namespace std;
int main()
{
char operation;
int num1 , num2;
cout << "Enter operator either + or - or * or /: "<<endl;
cin >> operation;
cout << "Enter First operand: "<<endl;
cin >> num1;
cout << "Enter Second operand: "<<endl;
cin >> num2;
switch(operation) {
case '+' :
cout<<"The Answer Is: " << num1+num2<<endl;
break;
case '-' :
cout<<"The Answer Is: " << num1-num2<<endl;
break;
case '*' :
cout<<"The Answer Is: " << num1*num2<<endl;
break;
case '/' :
cout<<"The Answer Is: "<< num1/num2<<endl;
break;
default:
/* If operater is other then +, -, * or /, error message is shown */
cout << "Error! operator is not correct";
break;
}
cout<< "******************" << "\n"
<< "Regards Talha Ch"<< "\n"
<< "******************" << "\n"
<< endl;
return 0;
}
using namespace std;
int main()
{
char operation;
int num1 , num2;
cout << "Enter operator either + or - or * or /: "<<endl;
cin >> operation;
cout << "Enter First operand: "<<endl;
cin >> num1;
cout << "Enter Second operand: "<<endl;
cin >> num2;
switch(operation) {
case '+' :
cout<<"The Answer Is: " << num1+num2<<endl;
break;
case '-' :
cout<<"The Answer Is: " << num1-num2<<endl;
break;
case '*' :
cout<<"The Answer Is: " << num1*num2<<endl;
break;
case '/' :
cout<<"The Answer Is: "<< num1/num2<<endl;
break;
default:
/* If operater is other then +, -, * or /, error message is shown */
cout << "Error! operator is not correct";
break;
}
cout<< "******************" << "\n"
<< "Regards Talha Ch"<< "\n"
<< "******************" << "\n"
<< endl;
return 0;
}
Tuesday, February 7, 2017
use of if else in c++
#include<iostream>
#include<conio.h>
using namespace std;
main()
{
double amount, discount, netPayable ; amount = 0 ; netPayable = 0 ; discount = 0 ;
cout << "Please enter the amount of the bill"<<endl;
cin >> amount;
if ( amount > 5000 )
{
discount = amount * (15.0 / 100);
netPayable = amount - discount;
cout << "The payable amount is=Rs" << netPayable <<endl;
cout << "The discount at the rate 15 % is=Rs" << discount << endl;
}
else
{
discount = amount * (10.0 / 100);
cout << "The discount at the rate 10 % is=Rs" << discount<< endl;
netPayable = amount - discount ;
cout << "The payable amount is=Rs" << netPayable;
}
}
#include<conio.h>
using namespace std;
main()
{
double amount, discount, netPayable ; amount = 0 ; netPayable = 0 ; discount = 0 ;
cout << "Please enter the amount of the bill"<<endl;
cin >> amount;
if ( amount > 5000 )
{
discount = amount * (15.0 / 100);
netPayable = amount - discount;
cout << "The payable amount is=Rs" << netPayable <<endl;
cout << "The discount at the rate 15 % is=Rs" << discount << endl;
}
else
{
discount = amount * (10.0 / 100);
cout << "The discount at the rate 10 % is=Rs" << discount<< endl;
netPayable = amount - discount ;
cout << "The payable amount is=Rs" << netPayable;
}
}
Calculate price of your total grocery with c++
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string mystr;
float price=0;
int quantity=0;
cout << "Enter price: ";
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Enter quantity: ";
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Total price: " << price*quantity << endl;
return 0;
}
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string mystr;
float price=0;
int quantity=0;
cout << "Enter price: ";
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Enter quantity: ";
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Total price: " << price*quantity << endl;
return 0;
}
Password Cracking Prank with c++
#include <iostream>
#include <ctime>
using namespace std;
string crackPassword(string pass);
long long int attempt;
clock_t start_t, end_t;
int main(){
string password;
cout << "Enter the password to crack : ";
cin >> password;
cout << endl << endl << endl << ">\n>> CRACKED THE PASSWORD! >>\n>" << endl << endl <<"The password : " << crackPassword(password) << endl;
cout << "The number of attempts : " << attempt << endl;
cout << "The time duration passed : " << (double)(end_t - start_t)/1000 << " seconds" << endl << endl;
return 0;
}
string crackPassword(string pass){
int digit[7],alphabetSet=1,passwordLength=1;
start_t = clock();
string test,alphabet = "1337 also daktari is pro";
while(1){
switch(passwordLength){
case 1:
while(alphabetSet<4){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
}
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 2:
alphabetSet=1;
while(alphabetSet<6){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
}
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 3:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 4:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 5:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 6:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 7:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[6]=0;digit[6]<alphabet.length();digit[6]++)
for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 8:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[7]=0;digit[7]<alphabet.length();digit[7]++)
for(digit[6]=0;digit[6]<alphabet.length();digit[6]++)
for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
}
cout << endl << endl << endl << endl << "*" << endl;
cout << "*** Password length is not " << passwordLength << ". Increasing password length! ***";
cout << endl << "*" << endl << endl;
passwordLength++;
}
}
#include <ctime>
using namespace std;
string crackPassword(string pass);
long long int attempt;
clock_t start_t, end_t;
int main(){
string password;
cout << "Enter the password to crack : ";
cin >> password;
cout << endl << endl << endl << ">\n>> CRACKED THE PASSWORD! >>\n>" << endl << endl <<"The password : " << crackPassword(password) << endl;
cout << "The number of attempts : " << attempt << endl;
cout << "The time duration passed : " << (double)(end_t - start_t)/1000 << " seconds" << endl << endl;
return 0;
}
string crackPassword(string pass){
int digit[7],alphabetSet=1,passwordLength=1;
start_t = clock();
string test,alphabet = "1337 also daktari is pro";
while(1){
switch(passwordLength){
case 1:
while(alphabetSet<4){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
}
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 2:
alphabetSet=1;
while(alphabetSet<6){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
}
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 3:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 4:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 5:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 6:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 7:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[6]=0;digit[6]<alphabet.length();digit[6]++)
for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
case 8:
alphabetSet=1;
while(alphabetSet<8){
switch(alphabetSet){
case 1 : alphabet = "-0123456789";
cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait"; break;
case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait"; break;
case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait"; break;
case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait"; break;
case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait"; break;
case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait"; break;
case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait"; break;
}
for(digit[7]=0;digit[7]<alphabet.length();digit[7]++)
for(digit[6]=0;digit[6]<alphabet.length();digit[6]++)
for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
attempt++;
if(attempt%2500000==0) cout << ".";
test=alphabet[digit[0]];
for(int i=1;i<passwordLength;i++)
if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
if(pass.compare(test)==0){end_t = clock(); return test;}
}
alphabetSet++;
}
break;
}
cout << endl << endl << endl << endl << "*" << endl;
cout << "*** Password length is not " << passwordLength << ". Increasing password length! ***";
cout << endl << "*" << endl << endl;
passwordLength++;
}
}
How Write Allah With C++
#include<iostream>
using namespace std;
main(){
cout<<endl<<endl;
for(int i = 0; i<40; i++){
if(i<4){
if(i == 0){
cout<<" *\t** \t**\t**\n";
}else if(i==2){
cout<<" * * \t**\t**\t**\n";
cout<<" * * \t**\t**\t**\n";
}
else if(i == 3){
cout<<"* * \t**\t**\t**\n";
}else{
cout<<" **\t**\t**\t**\n";
}
}else if(i >= 4 && i<22){
cout<<"*";
}else{
cout<<" ";
}
}
cout<<endl;
system("pause");
}
using namespace std;
main(){
cout<<endl<<endl;
for(int i = 0; i<40; i++){
if(i<4){
if(i == 0){
cout<<" *\t** \t**\t**\n";
}else if(i==2){
cout<<" * * \t**\t**\t**\n";
cout<<" * * \t**\t**\t**\n";
}
else if(i == 3){
cout<<"* * \t**\t**\t**\n";
}else{
cout<<" **\t**\t**\t**\n";
}
}else if(i >= 4 && i<22){
cout<<"*";
}else{
cout<<" ";
}
}
cout<<endl;
system("pause");
}