第一个只出现一次的字符(剑指offer 35)360笔试
来源:互联网 发布:python数字类型转换 编辑:程序博客网 时间:2024/05/21 19:34
#include<iostream> #include<string>using namespace std;char find(char *s){int hash[256] = { 0 };char *phashkey = s;while(*phashkey!='\0'){hash[*phashkey]++;phashkey++;}phashkey = s;while (*phashkey != '\0'){if (hash[*phashkey] == 1)return *phashkey;phashkey++;}//return '\0';}int main(){int n, m = 0;char s[256];cin >> n;char *b = new char[n];for (int j = 0; j < n; j++){cin >> s;b[m++] = find(s);}for (int i = 0; i < m; i++)cout << b[i] << endl;system("pause");return 0;}
0 0
- 第一个只出现一次的字符(剑指offer 35)360笔试
- 剑指offer(35)第一个只出现一次的字符
- 剑指offer-35 第一个只出现一次的字符
- 剑指Offer 35 第一个只出现一次的字符
- 剑指offer 35 第一个只出现一次的字符
- 第一个只出现一次的字符 (剑指offer)
- 【剑指offer】第一个只出现一次的字符
- 剑指offer--第一个只出现一次的字符
- 剑指Offer之 - 第一个只出现一次的字符
- 《剑指offer》第一个只出现一次的字符位置
- 剑指offer:第一个只出现一次的字符位置
- 剑指Offer--第一个只出现一次的字符位置
- 【剑指Offer】第一个只出现一次的字符位置
- 【剑指offer】之第一个只出现一次的字符
- 剑指offer:第一个只出现一次的字符位置
- [剑指offer]第一个只出现一次的字符位置
- 《剑指offer》-第一个只出现一次的字符位置
- 剑指offer|第一个只出现一次的字符位置
- php与html简单的json交互示例
- 基本开源协议介绍
- NSIS 背景动态切换显示图片 (学习七)
- android LinearLayout添加分隔线
- 54. Attribute isId 属性
- 第一个只出现一次的字符(剑指offer 35)360笔试
- Oracle 11g安装图文攻略
- webview 和 textview 解析html 之间进行比较
- Python爬虫之<XPath与多线程爬虫>
- 添加tabs出现两个滚动条问题
- HDOJ 题目分类
- Scala集合(二)
- mysql计算经纬度
- 55. Attribute name 属性