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