Advertisement
noshin98

uva 621

Jan 3rd, 2017
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int tc;
  7.     char s[2000];
  8.  
  9.     scanf("%d", &tc);
  10.     while (tc--) {
  11.         scanf("%s", s);
  12.  
  13.         int len = strlen(s);
  14.  
  15.         if (strcmp(s, "1") == 0 || strcmp(s, "4") == 0 || strcmp(s, "78") == 0)
  16.             printf("+\n");
  17.         else if (s[len - 1] == '5' && s[len - 2] == '3')
  18.             printf("-\n");
  19.         else if (s[0] == '9' && s[len - 1] == '4')
  20.             printf("*\n");
  21.         else if (s[0] == '1' && s[1] == '9' && s[2] == '0')
  22.             printf("?\n");
  23.         else
  24.             printf("+\n");
  25.     }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement