#include #include #include #include #include void RndPass ( int iLength ) { char cAlpha [] = {a,b,c,d,e,f,g,h,i,j,k,l, m,n,o, p,q,r,s,t,u,v,w,x,y,z,A,B ,C,D, E,F,G,H,I,J,K,L,M,N,O,P,Q ,R,S, T,U,V,W,X,Y,Z,0,1,2,3,4,5 ,6,7,8,9}; for ( ; iLength > 0; iLength-- ) { cout<< cAlpha [ rand() % 61 ]; } } int main () { int iLength; int chars; int k; srand(time(NULL)); cout << " Coded by "; cout << " .:negative zer0:. "<< endl << endl; cout << "Enter how many password you want: "; cin >> chars; cout << endl; cout << "Enter password length: "; cin >> iLength; cout << endl; for ( k = 1; k <= chars; k++ ) { RndPass(iLength); cout << endl << endl; } return(0); } |
|