Advertisement
juanjo12x

UVA_621_Secret_Research

Jun 1st, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main(int argc, char** argv) {
  5.     int t;/*number of test cases*/
  6.     scanf("%d",&t);char input[10000];
  7.     int num;/*number of input*/
  8.     int n;/*length of string*/
  9.     while(t--){
  10.         scanf("%s",&input);
  11.         if (!strcmp(input,"4")||!strcmp(input,"1")||!strcmp(input,"78")) printf("+\n");
  12.         else{
  13.             n=strlen(input);
  14.             if(input[n-2]=='3'&& input[n-1]=='5') printf("-\n");
  15.             else if (input[0]=='9' && input[n-1]=='4') printf("*\n");
  16.             else if (input[0]=='1' && input[1]=='9' && input[2]=='0') printf("?\n");
  17.         }
  18.        
  19.        
  20.     }
  21.     return (EXIT_SUCCESS);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement