The link address is: http://acm.zju.edu.cn/show_problem.php?pid=1698
Under IE do not know why not normal display this write a new article, it is now published under opera, and I don't know what it will look like. For a long time did not write the article, one is to engage in the simple problem of ACM. In fact, a little fun in life is not a bad time to cut a simple problem??
The code is as follows:
#include < iostream >
using namespace Std;
int main ()
{
Char ch,array[20];
int position;
bool tag = false;
Position = 0;
while (tag = false)
{
ch = getchar ();
if (ch!= ')
{
Array[position + +] = ch;
}
else if (ch = = ")
{
if (array[0] = = ' E ' && array[1] = = ' n ' && array[2] = = ' d ')
{
Tag = true;
}
Else
{
BOOL get = FALSE;
for (int i = 0; i < position + i)
{
if (array[i] = = ' A ' | | Array[i] = = ' E ' | | Array[i] = = ' I ' | |
Array[i] = = ' O ' | | Array[i] = = ' U ')
{
get = true;
break;
}
}
if (get = = False)
{
cout << "<";
for (int i = 0; i < position + i)
{
cout << Array[i];
}
cout << "> is not acceptable." << Endl;
}
Else
{
get = false;
int count = 0;
for (int i = 0; i < position + i)
{
if (Count >= 3)
{
break;
}
if (array[i] = = ' A ' | | Array[i] = = ' E ' | | Array[i] = = ' I ' | |
Array[i] = = ' O ' | | Array[i] = = ' U ')
{
if (get = = False)
{
+ + count;
}
Else
{
get = false;
Count = 1;
}
}
Else
{
if (get = = False)
{
get = true;
Count = 1;
}
Else
{
+ + count;
}
}
}
if (Count >= 3)
{
cout << "<";
for (int i = 0; i < position + i)
{
cout << Array[i];
}
cout << "> is not acceptable." << Endl;
}
Else
{
int i = 0;
for (i = 1; i < position; + i)
{
if (array[i-1] = = Array[i])
{
if (Array[i]!= ' o ' && array[i]!= ' e ')
{
i =-1;
break;
}
}
}
if (i = = 1)
{
cout <<