Language: C

/* ***********************************************
Author        :CKboss
Created Time  :2015蟷エ01譛?7譌・ 譏滓悄蜈ュ 00譌カ19蛻?3遘?File Name     :fenxi.cpp
************************************************ */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

/// 33 KeyWords
char KeyWord[35][10] =
{ "auto","break","case","char","const","continue",
"default","do","double","else","enum","extern",
"float","for","goto","if","int","long","bool",
"register","return","short","signed","sizeof","static",
"struct","switch","typedef","union","unsigned","void",
"volatile","while"};

/// 21 sig
char sig[22][5] = { "=","+","-","*","/","<","<=","!","&","|","~","^",">",">=","==",";","(",")","#","++","--" };

map<int,string> mis;

/*****************ac********************************/

const int maxn = 1000;

int ch[maxn][130],fail[maxn],end[maxn];
int root,sz;

int newnode()
{
	memset(ch[sz],-1,sizeof(ch[sz]));
	end[sz++]=0;
	return sz-1;
}

void ac_init()
{
	sz=0; root = newnode();
}

void insert(char str[],int id)
{
	int len = strlen(str);
	int now = root;
	for(int i=0;i<len;i++)
	{
		int& temp = ch[now][(int)str[i]];
		if(temp==-1) temp = newnode();
		now = temp;
	}
	end[now]=id;
}

void build()
{
	queue<int> q;
	fail[root] = root;
	for(int i=0;i<130;i++)
	{
		int& temp = ch[root][i];
		if(temp==-1) temp = root;
		else
		{
			fail[temp]=root;
			q.push(temp);
		}
	}
	while(!q.empty())
	{
		int now = q.front(); q.pop();
		for(int i=0;i<130;i++)
		{
			if(ch[now][i]==-1)
				ch[now][i]=ch[fail[now]][i];
			else
			{
				fail[ch[now][i]]=ch[fail[now]][i];
				q.push(ch[now][i]);
			}
		}
	}
}

vector<int> vi;
vector<int> pos;

void query(char str[])
{
	int len = strlen(str);
	int now = root;
	int ret = 0;

	queue<int> qq;
	queue<int> ppp;

	for(int i=0;i<len;i++)
	{
		now = ch[now][(int)str[i]];
		int temp = now;
		while(temp!=root&&end[temp])
		{
			/// 謇セ蛻ー荳?クェ蜈ウ髞ョ蟄玲?閠?ョ玲惘隨ヲ蜿キ
			qq.push(end[temp]); ppp.push(i);
			temp = fail[temp];
		}
	}

	while(!qq.empty())
	{
		int f = qq.front(); qq.pop();
		int p = ppp.front(); ppp.pop();
		/// 蟇ケ >= <= == ++ -- 逧?愛譁ュ
		if(f==47||f==40||f==48||f==53||f==54)
		{
			vi.pop_back(); qq.pop();
			pos.pop_back(); ppp.pop();
		}
		/// do 蜥?double 逧?愛譁ュ
		if(f==9)
		{
			vi.pop_back();
			pos.pop_back();
		}
		vi.push_back(f);
		pos.push_back(p);
	}
}

/*****************ac********************************/

map<string,int> msi;
map<string,int> mss;

int Len[1000];

void init()
{
	mis.clear();
	msi.clear(); mss.clear();
	ac_init();
	for(int i=0;i<33;i++) 
	{
		insert(KeyWord[i],i+1);
		msi[(string)KeyWord[i]]=i+1;
		mis[i+1]=KeyWord[i];
		Len[i+1]=strlen(KeyWord[i]);
	}
	for(int i=0;i<21;i++) 
	{
		insert(sig[i],i+34);
		mss[(string)sig[i]]=i+34;
		mis[i+34]=sig[i];
		Len[i+34]=strlen(sig[i]);
	}
	build();
}

bool isLetter(char c)
{
	if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) return true;
	else return false;
}

bool isDigit(char c)
{
	if(c>='0'&&c<='9') return true;
	return false;
}

bool isEmpty(char c)
{
	if(c=='\n'||c=='\t'||c==' ') return true;
	return false;
}

bool checkVar(string str)
{
	int len = str.length(),i=0;
	while(isEmpty(str[i])) { i++; continue; }
	int state = 0;
	if(isLetter(str[i])==true) state = 1,i++; else return false;
	for(;i<len;i++) { if(isDigit(str[i])==true||isLetter(str[i])==true) continue; else break; }
	bool flag=true;
	for(;i<len;i++)
	{
		if(isEmpty(str[i])) continue;
		else { flag=false; break; }
	}
	return flag;
}

bool checkInt(string str)
{
	int len = str.length(),i=0;
	while(isEmpty(str[i])) { i++; continue; }
	for(;i<len;i++) { if(isDigit(str[i])==true) continue; else break; }
	bool flag=true;
	for(;i<len;i++)
	{
		if(isEmpty(str[i])) continue;
		else { flag=false; break; }
	}
	return flag;
}

bool checkFloat(string str)
{
	int len = str.length(),i=0;
	while(isEmpty(str[i])) { i++; continue; }
	int state = 0;
	if(isDigit(str[i])==true) state = 1; 
	else if(str[i]=='.') goto label;
	else return false;
	for(;i<len;i++) { if(isDigit(str[i])==true) continue; else break; }
label:
	if(str[i]=='.') state = 2,i++; else return false;
	for(;i<len;i++) { if(isDigit(str[i])==true) continue; else break; }
	bool flag=true;
	for(;i<len;i++)
	{
		if(isEmpty(str[i])) continue;
		else { flag=false; break; }
	}
	return flag;
}

int checkOther(string str) /// 蜿倬? 1 謨エ謨ー 2 豬ョ轤ケ謨ー 3 譛ェ隸?悪 0
{
	bool fA=false; /// 蜷ォ譛牙ュ玲ッ?	bool fB=false; /// 蜷ォ譛画焚蟄?	bool fC=false; /// 蜷ォ譛?
	int len = str.length();
	for(int i=0;i<len;i++)
	{
		if(isLetter(str[i])) fA=true;
		if(isDigit(str[i])) fB=true;
		if(str[i]=='.') fC=true;
	}
	if(fA)///蜷ォ譛牙ュ玲ッ肴」?衍譏ッ蜷ヲ譏ッ蜿倬?
	{
		if(checkVar(str)) return 1;
		else return 0;
	}
	else
	{
		if(fC)
		{
			if(checkFloat(str)) return 3;
			else return 0;
		}
		else
		{
			if(checkInt(str)) return 2;
			else return 0;
		}
	}
	return 0;
}

int INT = 0, FLOAT = 0 , VAR = 0;
int NUM[100];

void solve(char* st)
{
	int sz= vi.size();
	int lastpos=0;
	string str = st;
	string temp ;
	int len = str.length();
	for(int i=0;i<sz;i++)
	{
		int beg = pos[i]+1-Len[vi[i]];
		int end = pos[i];
		int id = vi[i];
		/// 蟇ケ蠑?、エ蜥御クュ髣エ譽?衍
		if(beg==lastpos) ;
		else
		{
			int from = lastpos,to = beg-1;
			temp=str.substr(from,to-from+1);
			int kind = checkOther(temp);
			if(kind==1) cout<<"( "<<temp<<" , 蜿倬?)"<<endl;
			else if(kind==2) cout<<"( "<<temp<<" , 謨エ謨ー)"<<endl;
			else if(kind==3) cout<<"( "<<temp<<" , 豬ョ轤ケ謨ー)"<<endl;
			else if(kind==0) cout<<"( "<<temp<<" , 譛ェ隸?悪)"<<endl;
		}
		temp=str.substr(beg,end-beg+1);
		if(id<34)
			cout<<"( "<<temp<<" , 蜈ウ髞ョ蟄?"<<mis[id]<<++NUM[id]<<" )"<<endl;
		else
			cout<<"( "<<temp<<" , 隨ヲ蜿キ "<<mis[id]<<++NUM[id]<<" )"<<endl;

		if(i==sz-1)///蟇ケ扈灘ーセ譽?衍
		{
			if(end==len-1) ;
			else
			{
				int from = lastpos,to = len-1;
				int kind = checkOther(temp);
				if(kind==1) cout<<"( "<<temp<<" , 蜿倬?)"<<endl;
				else if(kind==2) cout<<"( "<<temp<<" , 謨エ謨ー)"<<endl;
				else if(kind==3) cout<<"( "<<temp<<" , 豬ョ轤ケ謨ー)"<<endl;
				else if(kind==0) cout<<"( "<<temp<<" , 譛ェ隸?悪)"<<endl;
			}
		}
		lastpos=end+1;
	}
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
	init();
	char str[100];
	memset(NUM,0,sizeof(NUM));
	VAR=0;INT=0;FLOAT=0;
	while(cin>>str)
	{
		vi.clear(); pos.clear();
		query(str);
		solve(str);
	}
	
    return 0;
}

Compiler output:
main.c:6:10: fatal error: iostream: No such file or directory
    6 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.