Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лабы / lab3 / lab3

.cpp
Скачиваний:
9
Добавлен:
17.04.2013
Размер:
709 б
Скачать
#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;
}

Соседние файлы в папке lab3
  • #
    17.04.20131.21 Кб9func.cpp
  • #
    17.04.2013105 б10func.h
  • #
    17.04.2013132.77 Кб9func.obj
  • #
    17.04.2013709 б9lab3.cpp
  • #
    17.04.20134.63 Кб9lab3.dsp
  • #
    17.04.2013531 б9lab3.dsw
  • #
    17.04.201366.56 Кб9lab3.ncb
  • #
    17.04.201348.64 Кб9lab3.opt
  • #
    17.04.20131.9 Кб9lab3.plg