## 12366 - King's Poker

Moderator: Board moderators

nest
New poster
Posts: 6
Joined: Sun May 20, 2012 10:18 am

### 12366 - King's Poker

#include<stdio.h>
int main()
{
int a,b,c;

while(scanf("%d%d%d",&a,&b,&c)==3){
if((a==0||b==0||c==0)||(a<0||b<0||c<0)||(a>13||b>13||c>13))
break;
if(a==13&&a==b&&a==c)
printf("*\n");

else if(a!=13&&a==b&&a==c)
printf("%d %d %d\n",a+1,b+1,c+1);
else if(a==b&&a!=13){
if(c<13){
if(c<a){

if(a==c+1)
printf("%d %d %d\n",a,b,c+2);
else
printf("%d %d %d\n",c+1,a,b);
}
else
printf("%d %d %d\n",a,b,c+1);
}
else
printf("1 %d %d\n",a+1,b+1);
}
else if(a==c&&a!=13){
if(b<13){
if(b<a){

if(a==b+1)
printf("%d %d %d\n",a,c,b+2);
else
printf("%d %d %d\n",b+1,a,c);
}
else
printf("%d %d %d\n",a,c,b+1);
}
else
printf("1 %d %d\n",a+1,c+1);
}
else if(b==c&&b!=13){
if(a<13){
if(a<c){

if(c==a+1)
printf("%d %d %d\n",b,c,a+2);
else
printf("%d %d %d\n",a+1,b,c);
}
else

printf("%d %d %d\n",b,c,a+1);
}
else
printf("1 %d %d\n",b+1,c+1);
}
else if(a!=b&&b!=c&&a!=c)
printf("1 1 2\n");
else if(a==13||b==13||c==13){
if(a==b||b==c||c==a){
if(a==12||b==12||c==12)
printf("1 1 1\n");
}
}

}

return 0;
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: pls tell me ; why wa

What's the problem number?
Check input and AC output for thousands of problems on uDebug!

nest
New poster
Posts: 6
Joined: Sun May 20, 2012 10:18 am

### Re: pls tell me ; why wa

12366.
sorry for that

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: pls tell me ; why wa

Try input 1 13 13
Check input and AC output for thousands of problems on uDebug!

uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

### Re: pls tell me ; why wa

In this problem, I wasn't careful enough to read that the input's terminated by

Code: Select all

``0 0 0``
Make sure you don't process this input else you're bound to get a WA.

In regards to test cases, posting all the critical cases would be akin to giving the answer away since the problem's not necessarily hard - and doesn't have any major "gotchas".

Also, since the title of this thread's not clear, I'm repeating the problem number and title below in the hope that this thread is returned by the forum search engine when a search for this problem is done.

12366 - King's Poker
Check input and AC output for over 7,500 problems on uDebug!