public class PascalsTriangle
{
public static void main(String[] args)
{
//number of rows
int r = 6;
for (int i = 0; i < r; i++)
{
for (int k = r; k > i; k--)
{
System.out.print(" ");
}
int num = 1;
for (int j = 0; j <= i; j++)
{
System.out.print(num + " ");
// Pascal's triangle formula
num = num * (i - j) / (j + 1);
}
//print a new line
System.out.println();
}
System.out.println("Decoder();");
}
}
@de_coder
{
public static void main(String[] args)
{
//number of rows
int r = 6;
for (int i = 0; i < r; i++)
{
for (int k = r; k > i; k--)
{
System.out.print(" ");
}
int num = 1;
for (int j = 0; j <= i; j++)
{
System.out.print(num + " ");
// Pascal's triangle formula
num = num * (i - j) / (j + 1);
}
//print a new line
System.out.println();
}
System.out.println("Decoder();");
}
}
@de_coder
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
static const char alphanum[] =
"0123456789"
"!@#$%^&*"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphanum) - 1;
int main()
{
//password length
int length = 8;
srand(time(0));
for (int i = 0; i < length; i++)
{
cout << alphanum[rand() % size];
}
cout << "\n\nDecoder();";
return 0;
}
@de_coder
#include <cstdlib>
#include <ctime>
using namespace std;
static const char alphanum[] =
"0123456789"
"!@#$%^&*"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphanum) - 1;
int main()
{
//password length
int length = 8;
srand(time(0));
for (int i = 0; i < length; i++)
{
cout << alphanum[rand() % size];
}
cout << "\n\nDecoder();";
return 0;
}
@de_coder