automata, check string is accepted by language | C++
<p>This is my automata, and it Regular Expression for this language is <code>(aaa*b|ba)a*</code></p>

<p><a href="https://i.stack.imgur.com/hjoca.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hjoca.jpg" alt="enter image description here"></a></p>

<p>I want to make a C++ program for check input string is accepted by this language or not.</p>

<p>This program get the string and print <code>Accepted</code> or <code>Rejected</code></p>

<p>For example:</p>

<p><em>input:</em> aaaba - <em>output:</em> Accepted</p>

<p><em>input:</em> baa - <em>output:</em> Accepted</p>

<p><em>input:</em> aaa - <em>output:</em> Rejected</p>