#include<iostream>
using namespace std;
int main()
{
char sEmail[10];
char *pAt = NULL;
char *pDot = NULL;
int iAtFlg = 0;
int iDotFlg = 0;
int iLineNum = 1;
cout << "Line Num : " << iLineNum;
iLineNum ++;
while(cin >> sEmail)
{
iAtFlg = 0;
iDotFlg = 0;
if (sEmail[0] == '@')
{
cout << "Error 1: First char is @" << endl;
cout << endl << "Line Num : " << iLineNum << " ";
iLineNum ++;
}
else
{
pAt = strchr(sEmail, '@');
if (NULL == pAt)
{
cout << "Error 2: No @" << endl;
cout << endl << "Line Num : " << iLineNum << " ";
iLineNum ++;
}
else
{
pDot = strchr(sEmail, '.');
if (NULL == pDot)
{
cout << "Error 3: No ." << endl;
cout << endl << "Line Num : " << iLineNum << " ";
iLineNum ++;
}
else
{
if(pDot - pAt <= 1)
{
cout << "Error 4: @ next is ." << endl;
cout << endl << "Line Num : " << iLineNum << " ";
iLineNum ++;
}
else
{
if ('\0' == *(pDot + 1))
{
cout << "Error 5: Last char is ." << endl;
cout << endl << "Line Num : " << iLineNum << " ";
iLineNum ++;
}
else
{
cout << "Email " << sEmail << "is an legitimate" << endl;
}
}
}
}
}
}
return 0;
}