Skip to content

Instantly share code, notes, and snippets.

@shohan4556
Created March 10, 2015 03:24
Show Gist options
  • Select an option

  • Save shohan4556/2ceb9c7bda648f883674 to your computer and use it in GitHub Desktop.

Select an option

Save shohan4556/2ceb9c7bda648f883674 to your computer and use it in GitHub Desktop.
URI : 1467 -- Zero or One solution
/// URI : 1467 -- Zero or One
/// Author : Shohanur Rahaman
#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)
printf("*\n");
else if(a==1 && b==0 && c==0)
printf("A\n");
else if(a==0 && b==1 && c==0)
printf("B\n");
else if(a==0 && b==0 && c==1)
printf("C\n");
else if(a==0 && b==1 && c==1)
printf("A\n");
else if(a==1 && b==0 && c==1)
printf("B\n");
else if(a==1 && b==1 && c==0)
printf("C\n");
else
printf("*\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment