#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
char getPoker(int val)
{
if(val==1)
{
return 'A';
}
else if(val<10)
{
return val+'0';
}
else if(val==10)
{
return '0';
}
else if(val==11)
{
return 'J';
}
else if(val==12)
{
return 'Q';
}
else if(val==13)
{
return 'K';
}
}
void printAns(int flag,int *poker,char *oper,char *answer)
{
char a=getPoker(poker[0]);
char b=getPoker(poker[1]);
char c=getPoker(poker[2]);
char d=getPoker(poker[3]);
switch(flag)
{
//1.((A*B)*C)*D
case 1:
printf("((%c%c%c)%c%c)%c%c\n",a,oper[0],b,oper[1],c,oper[2],d);
break;
//2.(A*(B*C))*D
case 2:
printf("(%c%c(%c%c%c))%c%c\n",a,oper[0],b,o
#include <stdlib.h>
#include <math.h>
#include <time.h>
char getPoker(int val)
{
if(val==1)
{
return 'A';
}
else if(val<10)
{
return val+'0';
}
else if(val==10)
{
return '0';
}
else if(val==11)
{
return 'J';
}
else if(val==12)
{
return 'Q';
}
else if(val==13)
{
return 'K';
}
}
void printAns(int flag,int *poker,char *oper,char *answer)
{
char a=getPoker(poker[0]);
char b=getPoker(poker[1]);
char c=getPoker(poker[2]);
char d=getPoker(poker[3]);
switch(flag)
{
//1.((A*B)*C)*D
case 1:
printf("((%c%c%c)%c%c)%c%c\n",a,oper[0],b,oper[1],c,oper[2],d);
break;
//2.(A*(B*C))*D
case 2:
printf("(%c%c(%c%c%c))%c%c\n",a,oper[0],b,o