各位大侠帮帮小弟偶做个程序吧..偶急用..万分感谢
一共6位数 x x x x x x 每位都随机0-9中任意一个数字
万分感谢..小弟在线等...偶需要一个完整的...
各位大侠帮帮忙吧...
一共6位数 x x x x x x 每位都随机0-9中任意一个数字
万分感谢..小弟在线等...偶需要一个完整的...
各位大侠帮帮忙吧...
2007-04-10 11:06
不知道这个行不行?呵呵...
#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");
}
2007-04-10 13:40