电竞比分网-中国电竞赛事及体育赛事平台

分享

【編程】隨機(jī)密碼生成代碼

 自由撰寫者 2013-09-03

  #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);

  }

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多