Advertisement
shipon_diu

UVA-621

Feb 6th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstring>
  4. using namespace std;
  5. int main()
  6. {
  7.  
  8.     int a,i=0,c;
  9.     char str[10000];
  10.     scanf("%d",&a);
  11.     while(i<a){
  12.         scanf("%s",str);
  13.         c=strlen(str);
  14.  
  15.         if(str[c-1]-48==5 && str[c-2]-48==3){
  16.                 printf("-\n");
  17.         }
  18.         else if(str[c-1]-48==4 && str[0]-48==9){
  19.                 printf("*\n");
  20.         }
  21.         else if(str[0]-48==1 && str[1]-48==9 && str[2]-48==0){
  22.                 printf("?\n");
  23.         }
  24.         else{
  25.             printf("+\n");
  26.         }
  27.         i++;
  28.  
  29.     }
  30.     return 0;
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement