środa, 22 lutego 2017

transition graph

#include <iostream>


using namespace std;

int value_letter[15];

char *letter_Value[15]={"BCF","AFHKL","CEF","CDEJI","ADEF","MNO","CDE",
"ADH","EFGH","CEKL","ABE","ABC","CFJ","EFGH","ABM"};

char give_Letter(char a)
{
    return ((a)-'A');
}

void Read(char letter)
{
    char *temp_text;
    value_letter[give_Letter(letter)]=1;
    cout<<letter<<endl;
    for(temp_text=letter_Value[give_Letter(letter)];*temp_text;temp_text++)
     if(!(value_letter[give_Letter(*temp_text)]))
      Read(*temp_text);
}

   





int main(int argc, char **argv)
{
    char my_letter;
    for(my_letter='A';my_letter<'P';my_letter++)
     if(!(value_letter[give_Letter(my_letter)]))
      Read(my_letter);

   
    return 0;
}

Brak komentarzy:

Prześlij komentarz