博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
编译原理实验一
阅读量:4684 次
发布时间:2019-06-09

本文共 908 字,大约阅读时间需要 3 分钟。

 

 

#include 
#include
#include
#include
using namespace std;int Vt[30],Vn[30];vector
P;//char str[100];int tl,nl;void init(){ tl=nl=0;}void split(string str,string p){ int i; if(str=="") return; str+=p; int len = str.size(); int pos = str.find(p); cout<
<
='a') Vt[str[i]-'a']++; else if(str[i]!='S' && str[i]<='Z' && str[i]>='A') Vn[str[i]-'A']++; } split(str,","); //test(); }}void output(){ int i; cout<<"(Vt={ "; for(i=0;i<26;i++) { if(Vt[i]) { cout<<(char)('a'+i);i++;break; } } for(;i<26;i++) { if(Vt[i]) cout<<","<<(char)('a'+i); } cout<<"},Vn={S"; for(i=0;i<26;i++) { if(Vn[i]) cout<<","<<(char)('A'+i); } cout<<"},P={ "; for(vector
::iterator it = P.begin(); it!=P.end();) { cout<<","<<*(it);it++; } cout<<"},S)"<

 

转载于:https://www.cnblogs.com/qlky/p/6555375.html

你可能感兴趣的文章
vue 用huilder打包APP时,安卓按返回键就退出App改为按两次再退出App
查看>>
vue-学习系列之vue双向绑定原理
查看>>
CSS布局--垂直水平居中
查看>>
MFC中 用Static控件做超链接(可以实现变手形、下划线、字体变色等功能)
查看>>
20144303 《Java程序设计》第五周学习总结
查看>>
多线程(第三天)
查看>>
python 抓取小说网站,制作电子书。
查看>>
restframework视图三部曲
查看>>
失去光标display=none事件的坑
查看>>
Python3.x:函数定义
查看>>
NOI 2014 起床困难综合症
查看>>
[LeetCode] Majority Element II
查看>>
设计模式的理解
查看>>
[cocos2dx动作]CCLabel类数字变化动作
查看>>
(转)Excel的 OleDb 连接串的格式(连接Excel 2003-2013)
查看>>
JAVA面试——分布式锁
查看>>
HDU2588--GCD(欧拉函数)
查看>>
负载均衡服务器
查看>>
ruby之gem install
查看>>
Linux下samba编译与安装(Ubuntu和嵌入式linux)
查看>>