Добавил:
korayakov
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
#include "stdafx.h"
#include <iostream>
#include <string>
#include "func.h"
using namespace std;
int main()
{
// Вывод задания.
cout<<"G=({S,A,B,C,D,E},{a,b,c,d,e,f,g},P,S)"<<endl;
cout<<"S->aAB|E"<<endl;
cout<<"A->dDA|o"<<endl;
cout<<"B->bE|f"<<endl;
cout<<"C->cAB|dSD|a"<<endl;
cout<<"D->eA"<<endl;
cout<<"E->fA|g"<<endl<<endl;
string str; // Искомый путь.
string ptr;// Проверяемое слово. (Например, "abg","af","abf")
while(1)
{
cout<<"‚ўҐ¤ЁвҐ б«®ў®: "<<endl;
cin>>ptr;
str=func(ptr);
cout<<"ptr = "<<ptr<<endl;
cout<<"str = "<<str<<endl;
if(str.compare(ptr)==0) cout<<"Supported"<<endl;
else cout<<"Not supported"<<endl;
}
return 0;
}