当前位置:网站首页>7-34 delete duplicate characters (set usage) & 7-35 count the number of characters (unordered_map)
7-34 delete duplicate characters (set usage) & 7-35 count the number of characters (unordered_map)
2022-04-22 08:25:00 【Shanlan ~】

#include <bits/stdc++.h>
using namespace std;
int main()
{
set<char> s;
char x;
while((x = getchar())!='\n')
{
s.insert(x);
}
for(auto it : s)
cout << it;
}
This is where you read in the blanks , Cannot add :
while(cin>> x)
A single character containing a space should know how to write ;
Topic two

#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin,s);
char x;
x = getchar();
unordered_map <char, int> hash;
for(int i = 0 ; i < s.size() ; i ++)
{
hash[s[i]]++;
}
cout << hash[x] << endl;
}
版权声明
本文为[Shanlan ~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220712432437.html
边栏推荐
- 氨基(-NH2)酞菁铜 cas: 28632-30-6 (四氨基酞菁)铜(II) 四氨基酞菁铜(CuTAPc)的多种叫法-齐岳生物小编分享
- Redis入门必读
- Wechat applet page routing
- numpy stack函数
- LeetCode_ 118. Yanghui triangle_ Dynamic programming_ Int * * learning
- Is NFT just a beautiful foam?
- 光纤传输16路E1+4路千兆隔离以太网络光端机2M专网千兆以太网综合多业务PDH光端机
- Dual optical port 1 + 1 backup 8-way E1 + 2-way Gigabit isolation network 4-way 100m isolation PDH optical transceiver
- REINFORCE
- Sun Yuchen, founder of wave field Tron, announced that it will officially launch the decentralized stable currency usdd
猜你喜欢

酞菁铂cas:14075-08-2|酞菁锌ZnPc|介孔硅@上转换@ZnPc光敏剂100nm以下发射650nm

tf.keras.layers.Dense函数

Fluorescently labeled hyaluronic acid

Network principle II (Part I)

58技术沙龙第二十八期|安居客质量保障体系沙龙

16路E1光端机+4路百兆以太网络光端机PDH光端机2M综合业务光端机

Fluorescent labeled polypeptide / amino acid (FITC modified / AMC modified) Qiyue organism

Leetcode 111 Balanced binary tree (2022.04.21)

Blocking queue

Integrated optical access equipment 4-way 100m isolated Ethernet + 16-way E1 private network service 2m integrated service optical transceiver
随机推荐
16 way E1 optical transceiver + 4-way 100M Ethernet optical transceiver PDH optical transceiver 2m integrated service optical transceiver
Integrated service PDH optical transceiver 4-way Gigabit isolated Ethernet + 4-way E1 private network service 2m integrated service optical transceiver
Is NFT just a beautiful foam?
MySQL深入学习(三二):数据库其它调优策略
MySQL深入学习(三一):PowerDesigner的使用
Q-Learning & Sarsa
Welcoming the era of stable currency 3.0, usdd brings financial innovation
Phthalocyanine platinum CAS: 14075-08-2 | zinc phthalocyanine ZnPc | mesoporous silicon @ upconversion @ ZnPc photosensitizer, emission below 100nm 650nm
Experiment 4: Data Preprocessing
LabVIEW 2012中的收藏选板导入到LabVIEW 2013
Golang学习,指针,循环控制相关
SCRM加速行业化,制造业也开始玩私域流量了
qt designer 跳转,布局,样式
Hanyuan hi tech PDH optical transceiver double optical port protection + 4-way E1 + 4-way Gigabit Network + 4-way 100m network optical transceiver
3-1 compare size
Should everyone use OKR?
Anhydrous glucose CAS: 50-99-7 D (+) - glucose molecular weight: 180.156 molecular formula: C6H12O6 density and boiling point value
pyqt5使用内置数据库sqllite
nacos基础(4):配置nacos外部数据库
光纤传输16路E1+4路千兆隔离以太网络光端机2M专网千兆以太网综合多业务PDH光端机