fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. string haslo, haslo1;
  6. bool ok = true;
  7. int n;
  8. cin >> n;
  9. for(int i = 0; i < n; i ++){
  10. cin >> haslo >> haslo1;
  11. for(int x = 0; x < haslo.length(); x++){
  12. if(haslo.length() != haslo1.length()){
  13. ok = false;
  14. break;
  15. }
  16. else if(haslo[x] != haslo1[x]){
  17. if(haslo1[x] != '*')
  18. ok = false;
  19. break;
  20. }
  21. }
  22. if(ok)
  23. cout << "ok" << endl;
  24. else
  25. cout << "error" << endl;
  26. }
  27.  
  28. }
Success #stdin #stdout 0s 4524KB
stdin
2
fraktal
**ak**l
FRAKTAL
F*RAKTAL
stdout
ok
error