python龟兔赛跑编程c语言_大学C语言编程龟兔赛跑

#include 

#include 

#include 

#include 

void guitu(void);

main()

{

srand(time(NULL));

guitu();

return 0;

}

void guitu()

{

int j,count= 0,cou = 0,number;

char printfun[71];

while (1)

{

for(j = 0;j<70;j++)

{

printfun[j] = '|';

printfun[70] = '|';

}

number = rand ()%10 + 1;

printf ("\n");

if (number>=1 && number<=5)

{

count+=3;

if(count>70)

{

count = 0;

}

printfun[count] = 'G';

}

if (number>=6 && number<=7)

{

count-=6;

if (count<0)

{

count = 0;

}

printfun[count] = 'G';

}

if (number>=8 && number<=10)

你可能感兴趣的:(python龟兔赛跑编程c语言)