Skip to content

Commit 82d5109

Browse files
committed
Added 1821A - Matching.cpp
1 parent d7de4cc commit 82d5109

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

1821A - Matching.cpp

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int solve(string s)
10+
{
11+
int ans=1;
12+
if(s[0]=='0')
13+
return 0;
14+
for(int i=1;i<s.size();i++)
15+
{
16+
if(s[i]=='?')
17+
ans *= 10;
18+
}
19+
if(s[0]=='?')
20+
ans *= 9;
21+
return ans;
22+
}
23+
int main()
24+
{
25+
int t;
26+
cin>>t;
27+
while(t--)
28+
{
29+
string s;
30+
cin>>s;
31+
cout<<solve(s)<<endl;
32+
}
33+
return 0;
34+
}

0 commit comments

Comments
 (0)