fork(2) download
  1. #include <iostream>
  2. #include <string>
  3. #include <math.h>
  4.  
  5. using namespace std;
  6.  
  7. int liczbaTestow, dlugoscKodu;
  8. string kod;
  9. int znakZapytania;
  10. bool znakZapytania_0;
  11.  
  12.  
  13. int main()
  14. {
  15. cin >> liczbaTestow;
  16.  
  17. for (int j = 0; j < liczbaTestow; j++)
  18. {
  19. znakZapytania = 0;
  20. znakZapytania_0 = 0;
  21.  
  22. cin >> dlugoscKodu >> kod;
  23.  
  24. if((kod[0]=='?') and (dlugoscKodu>1))
  25. znakZapytania_0=true;
  26.  
  27. for(int i=0;i<dlugoscKodu;i++)
  28. {
  29. if(kod=="?")
  30. znakZapytania++;
  31. else if((kod[i]=='?') and (i!=0))
  32. znakZapytania++;
  33.  
  34. }
  35.  
  36. if(znakZapytania_0==0)
  37. cout << pow(10,znakZapytania);
  38. else
  39. cout << pow(10,znakZapytania)*9;
  40.  
  41.  
  42. if (j!=liczbaTestow-1)
  43. {
  44. cout << endl;
  45. }
  46.  
  47. }
  48.  
  49. return 0;
  50. }
  51.  
Success #stdin #stdout 0s 4796KB
stdin
Standard input is empty
stdout
Standard output is empty