Thursday, September 02, 2010

[UVa] 621 - Secret Research

After getting used to so many critical problems in UVa, you simply can't take this so simply while it is one of the silliest problems. Even the exception condition doesn't really needs a care.


#include "stdio.h"

int main() {

int n, len;
char in[10010];

scanf("%d",&n);

while(n--) {
scanf("%s",in);
if (!strcmp(in,"1") || !strcmp(in,"4") || !strcmp(in,"78"))
printf("+");
else {
len=strlen(in);
if (in[len-2]=='3' && in[len-1]=='5') printf("-");
else if (in[0]=='9' && in[len-1]=='4') printf("*");
else if (in[0]=='1' && in[1]=='9' && in[2]=='0') printf("?");
}
printf("\n");
}

return 0;

}

No comments:

Post a Comment

Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...