1、题目
#include<stdio.h>
#include <stdlib.h>
int main()
{
int min;
scanf("%d", &min);
int s1 = 0, s2 = 0, run = 10, rest = -1;
while (min--)
{
//乌龟的速度
s1 += 3;
if (run-- > 0)
{
//兔子的速度
s2 += 9;
}
//达到10分钟之后,兔子回头的计算方式
if (run == 0)
{
if (s2 > s1 &&rest != 0)
{
//休息30分钟
rest = 30;
}
else
{
run = 10;
}
}
//休息完了,重置回来
if (rest-- == 0)
{
run = 10;
}
}
if (s1 > s2)
{
printf("@_@ %d", s1);
}
else if (s1 < s2)
{
printf("^_^ %d", s2);
}
else
{
printf("-_- %d", s2);
}
system("pause");
return 0;
}