不知道这个行不行?呵呵...
#include<stdlib.h>
#include<conio.h>
#include<time.h>
#include<stdio.h>
int main(void)
{
char c;
char i;
srand((unsigned)time(NULL));
c=rand()%10;
if(c==0)
c++;
printf("%d",c);
for(i=0;i<5;i++)
{
c=rand()%10;
printf("%d",c);
}
printf("\n");
}