Guest User

Untitled

a guest
Sep 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. char input[256];
  2. DFA dfa = oneA();
  3. while(1){
  4. printf("nEnter an input: ");
  5. scanf("%s", input);
  6. if (strcmp(input, "quit") == 0){
  7. break;
  8. }
  9. printf("nResults for input "%s": ", input);
  10. printf("%s", DFA_execute(dfa, input) ? "true" : "false");
  11. }
  12.  
  13. Testing DFA that recognizes exactly "zxy"
  14. Enter an input: *zxy*
  15. Results for input "zxy": true
  16.  
  17. Testing DFA that recognizes exactly "zxy"
  18. Enter an input: *zxy*
  19. zxy
  20.  
  21. Results for input "zxy": true
Add Comment
Please, Sign In to add comment