该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
#define MAX 100
int GuoQiao(int a[], int n)
{
int time;
if (n==1)
{
time=a[0];
printf("X->Y:%c\n",n+64);
return time;
}
else
if (n==2)
{
time=a[1];
printf("X->Y:%c,%c\n",n+63,n+64);
return time;
}
else
if (n==3)
{
time=a[0]+a[1]+a[2];
printf("X->Y:%c,%c\n",n+64,n+62);
printf("Y->X:%c\n",n+62);
printf("X->y:%c,%c\n",n+62,n+63);
return time;
}
else
{
if (2*a[1]>a[0]+a[n-2])
{
time=2*a[0]+a[n-1]+a[n-2];
printf("X->Y:%c,%c,\n",n+64,65);
printf("Y->X:%c\n",65);