View Code
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
int main()
{
    int i,j;
    char ss[6];
    srand((unsigned)time(NULL));
    for(i=1;i<=30;i++)
    {

        for(j=0;j<6;j++)
        {
            int temp=rand();
            temp=temp%10;
            if(temp<=3)
            ss[j]=temp+48;
            else
            if(temp<=7)
            ss[j]=temp+97;
            else
            ss[j]=temp+65;
        }
        for( j=0;j<6;j++)
        printf("%c",ss[j]);
        printf("\n");
    }
    
    return 0;
}
posted on 2012-10-20 23:41  一把刷子  阅读(319)  评论(0编辑  收藏  举报