这行怎么写
#include<stdio.h>#include<stdlib.h>
#include<time.h>
#include<windows.h>
int main()
{
int hp1=100,hp2=100;
int att1,att2;
int i=0;
while(hp1>=0&&hp2>=0)
{
att1=rand()%11+5;
att2=rand()%11+5;
hp2 -= att1;
hp1 -= att2;
printf("第%d轮,\n",i+1);
printf("玩家一攻击力%d,玩家二剩余血量%d\n",att1,hp2);
printf("玩家二攻击力%d,玩家一剩余血量%d\n",att2,hp1);
if (hp2<0)printf("玩家一赢,玩家一剩余血量%d,玩家二剩余血量%d,\n",hp1,hp2);
if(hp1 <0) printf("玩家二赢玩家一剩余血量%d,玩家二剩余血量%d,\n",hp1,hp2);
i++;
sleep (500);
}
return 0;
}
c(23) : warning C4013: 'sleep' undefined; assuming extern returning int