Ankit_132

A

May 29th, 2024
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int t;
  6.     cin>>t;
  7.     while(t--)
  8.     {
  9.         string s;
  10.         int lr=1, ud=1;
  11.         cin>>s;
  12.        
  13.         for(int i=0;i<4;i++)
  14.         {
  15.             if(s[i]=='1' and i<2)
  16.             {
  17.                 lr+=10;
  18.             }
  19.             if(s[i]=='1' and i>=2)
  20.             {
  21.                 ud+=10;
  22.             }
  23.         }
  24.         cout<<lr*ud<<endl;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment