#include<stdio.h> #include<string.h> int main() { char c,str[10000]; int n,len,len1,len2,j,i,x,f; scanf("%d",&n); getchar(); for(i=1;i<=n;) { f=0; gets(str); len=strlen(str); if((str[0]=='1')&&(str[1]=='\0')) printf("+"); else if((str[0]=='7')&&(str[1]=='\0')) printf("+"); else if((str[0]=='7')&&(str[1]=='8')&&(str[3]=='\0')) printf("+"); else if((str[len-2]=='3')&&(str[len-1]=='5')) printf("-"); else if ((str[0]=='9')&&(str[len-1]=='4')) printf("*"); else if((str[0]=='1')&&(str[1]=='9')&&(str[2]=='0')) printf("?"); else f=1; if((n>1)&&(f!=1)) printf("\n"); i=i+1; for(j=0;j<len;j++) str[j]=0; } return 0; }
ACM Problem Solution : 621
Labels:
ACM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment