#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void Up(int speed[])
{
int i;
for (i = 4; i > 0; i--)
{
if (speed[i] == 10)
{
speed[i - 1]++;
speed[i] = 0;
}
else break;
}
}
int main()
{
int speed[5] = { 9 ,5,8,5,9 };
int i;
do {
speed[4]++;
Up(speed);
if (speed[0] == speed[4] && speed[1] == speed[3])
break;
} while (1);
for (i = 0; i < 5; i++)
{
printf("%d ", speed[i]);
}
printf("\n");
return 0;
}
标签:int,Up,车速,break,++,printf,speed
From: https://www.cnblogs.com/258-333/p/17383136.html