Rakibul_Ahasan

Uva->621 Secret Research

Oct 10th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. /***
  2. **     Author: Rakibul Ahasan Papon
  3. **     Bangladesh University of Business and Technology,
  4. **     Dept. of CSE.
  5. ***/
  6.  
  7. #include <bits/stdc++.h>
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     int t;
  13.     cin>>t;
  14.     while(t--){
  15.         string S;
  16.         cin>>S;
  17.         int l=S.length();
  18.  
  19.             if(S.compare("1")==0 || S.compare("4")==0 || S.compare("78")==0){
  20.                 cout<<"+"<<endl;
  21.             }
  22.             else if(S[l-1]=='5' && S[l-2]=='3'){
  23.                 cout<<"-"<<endl;
  24.             }
  25.             else if(S[0]=='9' && S[l-1]=='4'){
  26.                 cout<<"*"<<endl;
  27.             }
  28.             else if(S[0]=='1' && S[1]=='9' && S[2]=='0'){
  29.                 cout<<"?"<<endl;
  30.             }
  31.             else {cout<<"+"<<endl;
  32.                 }
  33.  
  34.     }
Add Comment
Please, Sign In to add comment