写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文!
本博客全网唯一合法URL:http://www.cnblogs.com/acm-icpcer/p/8867199.html
Talk is cheap, show you my source code:
/* this code was first initiated by TZ contact email:xmb028@163.com personal website:wnm1503303791.github.io personal blogs:www.cnblogs.com/acm-icpcer/ this code has been posted on my personal blog,checking url:www.cnblogs.com/acm-icpcer/p/8867199.html Copyright © 2018 TZ. All Rights Reserved. */ #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<stack> #include<bitset> #include<cstdlib> #include<cmath> #include<set> #include<list> #include<deque> #include<map> #include<queue> using namespace std; char buffer[1024]; char remains[13][1024]= { "begin", "call", "const", "do", "end", "if", "odd", "procedure", "read", "then", "var", "while", "write" }; char r_output[13][1024]= { "beginsym", "callsym", "constsym", "dosym", "endsym", "ifsym", "oddsym", "proceduresym", "readsym", "thensym", "varsym", "whilesym", "writesym" }; int number(int i) { char temp[1024]; int t=0; while(buffer[i]>=48&&buffer[i]<=57) { temp[t++]=buffer[i++]; } cout<<"(number,"<<temp<<")"<<endl; return i; } int letter(int i) { char temp[1024]; memset(temp,'