fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int trans[4][2]={{1,2},{0,3},{3,0},{2,1}};
  5. char alfabeto[]={'a','b'};
  6.  
  7. int afd(char *entrada);
  8. int main(){
  9.  
  10. printf("%d", FuncaoTransicao(4));
  11. //return 0;
  12. }
  13. /*
  14. Implementacao de um AFD usando uma matriz
  15.  fun��o de transi��o : Q x Alfabeto -> Q
  16.  
  17. */
  18. int FuncaoTransicao(int q ){
  19.  
  20. return (q == 2) || (q ==1) || q == 0;// pois 1 eh o estado final
  21. }
Success #stdin #stdout 0s 4516KB
stdin
Standard input is empty
stdout
Standard output is empty