Tuesday, January 28, 2014

UVa 12646 - Zero or One solution

UVa 12646 - Zero or One: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4375

UVa 12646 - Zero or One solution: http://ideone.com/fuhEML

#include <iostream>
#include <stdio.h>
using namespace std;

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

note: it is my 1st prob solution ever on UVa. 

No comments:

Post a Comment