#include #include #include #include using namespace std; int tmain(int argc, char* argv[]) { ifstream inFile("vstup.txt"); ofstream outFile("vystup.txt"); if (inFile.is_open() && outFile.is_open()) { while(!inFile.eof()){ int n,m,init,*end=NULL,i=0; int **states; char line[1000]; inFile >> n >> m >> init; inFile.getline(line,1000); inFile.getline(line,1000); //nacitanie koncovych satavov char *pch; pch = strtok (line," "); while (pch != NULL){ int tmp; sscanf(pch,"%d",&tmp); i++; end = (int*)realloc(end,i*sizeof(int)); end[i-1]=tmp; pch = strtok (NULL, " "); } //nacitanie prechodov states = (int**)malloc(sizeof(int*)*n); for(int j=0;j> states[j][k]; } } //medzi kazdy prechod sa prida dalsi do medzistavu z ktoreho //pod tym istim pismenom sa dostavame do cieloveho podla povodneho automatu, inak slovo nepatri do jazyka int fn = n + m*n + 1; int **fstates; fstates = (int**)malloc(sizeof(int*)*fn); for(int j=0;j