Advertisement
enedil

AL_10_01

Apr 24th, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     ios_base::sync_with_stdio(0);
  8.     int t, a;
  9.     int wynik = 1;
  10.     string s;
  11.     cin >> t;
  12.     while(t) {
  13.         cin >> a;
  14.         cin.ignore(50, ' ');
  15.         getline(cin, s);
  16.         if (s[0] == '?')
  17.             wynik *= 9;
  18.         for (int i = 1; i < s.length(); ++i) {
  19.             if (s[i] == '?') {
  20.                 wynik *= 10;
  21.             }
  22.         }
  23.         cout << wynik << endl;
  24.         wynik = 1;
  25.         t--;
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement