能把完整的代码发一下嘛?我的确实有错
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<conio.h>
void main()
{
int i,j,k;
srand((unsigned)time(NULL));
j=0;
while(j<=100)
{
i=rand()%10;
k=rand()%10000;
j++;
getch();
printf("13");
printf("%d%4d\n",i,k);
sleep(1);
clrscr();
/* printf("13%d%4d\r",i,k);*/
}
getch();
}
这样就能满足你的要求了!
就是没办法退出来!
这个我就不会了!
--------------------Configuration: 1 - Win32 Debug--------------------
Compiling...
1.c
D:\1\1.c(20) : warning C4013: 'sleep' undefined; assuming extern returning int
D:\1\1.c(21) : warning C4013: 'clrscr' undefined; assuming extern returning int
Linking...
1.obj : error LNK2001: unresolved external symbol _clrscr
1.obj : error LNK2001: unresolved external symbol _sleep
Debug/1.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
1.exe - 3 error(s), 2 warning(s)
不会吧!!!