#include<stdio.h>
#define max(a,b) (a>b? a:b)
#define min(a,b) (a<b? a:b)
struct Number
{
int value;
char arrangement;
};
int main(void)
{
struct Number number[3];
char s[4];
int i, j, a, b, c;
scanf("%d%d%d", &a, &b, &c);
(number[0]).value = min(min(a, b), c);
(number[2]).value = max(max(a, b), c);
(number[1]).value = a+b+c-(number[2]).value - (number[0]).value;
(number[0]).arrangement = 'A';
(number[1]).arrangement = 'B';
(number[2]).arrangement = 'C';
scanf("%s", s);
for (j = 0; j < 3; j++)
{
for (i = 0; i < 3; i++)
{
if (s[j] == (number[i]).arrangement)
{
printf("%d ", (number[i]).value);
}
}
}
return(0);
}
洛谷P4414 [COCI2006-2007#2] ABC经典解法
最新推荐文章于 2024-09-28 14:47:59 发布