-
Notifications
You must be signed in to change notification settings - Fork 0
/
1821A.cpp
44 lines (40 loc) · 821 Bytes
/
1821A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
for (int t = 0; t < T; ++t)
{
string st;
cin >> st;
int count = 1;
bool contains = false;
for (int i = 0; i < st.size(); ++i)
{
if (st[i] == '?')
{
contains = true;
if (i == 0)
count *= 9;
else
count *= 10;
}
}
if (contains)
{
if (st[0] == '0')
cout << 0 << endl;
else
cout << count << endl;
}
else
{
if (st[0] == '0')
cout << 0 << endl;
else
cout << 1 << endl;
}
}
return 0;
}