12646 - Zero or One

All about problems in Volume 126. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

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

12646 - Zero or One

Post by brianfry713 » Sun Sep 07, 2014 3:11 am

Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!

mirukukafe
New poster
Posts: 2
Joined: Sun Oct 16, 2016 4:26 pm

Re: 12646 - Zero or One

Post by mirukukafe » Sun Oct 16, 2016 4:33 pm

why i got WA ?

Code: Select all

#include<stdio.h>

int main(){
	int a,b,c;
	
	scanf("%d %d %d", &a,&b,&c); getchar();
	if((a==0 && b==0 && c==0)||(a==1 && b==1 && c==1)){
		printf("*\n");
	}
	else if((a==1 && b==0 && c==0)||(a==0 && b==1 && c==1)){
		printf("A\n");
	}
	else if((a==0 && b==1 && c==0)||(a==1 && b==0 && c==1)){
		printf("B\n");
	}
	else{
		printf("C\n");
	}
	getchar();
	return 0;
}

Post Reply

Return to “Volume 126 (12600-12699)”