We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7de4cc commit 82d5109Copy full SHA for 82d5109
1821A - Matching.cpp
@@ -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
34
0 commit comments