文章目录

  • 一、Anton and Letters
  • 总结

一、Anton and Letters

本题链接:Anton and Letters

题目
A. Anton and Letters
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Recently, Anton has found a set. The set consists of small English letters. Anton carefully wrote out all the letters from the set in one line, separated by a comma. He also added an opening curved bracket at the beginning of the line and a closing curved bracket at the end of the line.

Unfortunately, from time to time Anton would forget writing some letter and write it again. He asks you to count the total number of distinct letters in his set.

Input
The first and the single line contains the set of letters. The length of the line doesn’t exceed 1000. It is guaranteed that the line starts from an opening curved bracket and ends with a closing curved bracket. Between them, small English letters are listed, separated by a comma. Each comma is followed by a space.

Output
Print a single number — the number of distinct letters in Anton’s set.

Examples
input
{a, b, c}
output
3

input
{b, a, b, a}
output
2

input
{}
output
0

本博客给出本题截图

题意:输入一个集合,去重后问集合内的元素个数

AC代码

#include <cstdio>
#include <set>
#include <iostream>using namespace std;set<int> s;int main()
{char c;scanf("%c", &c);char a;while (cin >> a){if (a == '}') break;if (a == ',' || a == ' ') continue;s.insert(a);}printf("%d\n", s.size());return 0;
}

总结

水题,不解释

Anton and Letters相关推荐

  1. 看懂nfl定理需要什么知识_NFL球队为什么不经常通过?

    看懂nfl定理需要什么知识 Debunking common NFL myths in an analytical study on the true value of passing the bal ...

  2. Codeforces Round #379 (Div. 2) A. Anton and Danik 水题

    A. Anton and Danik 题目连接: http://codeforces.com/contest/734/problem/A Description Anton likes to play ...

  3. IEEE signal processing letters 投稿经验

    转自:http://emuch.net/t.php?tid=6226942 前段时间比较幸运地中了一篇spl,把自己浅薄的经验写出来,直接从自己博客上转过来,分享给大家,望抛砖引玉吧~~~ 从投稿到录 ...

  4. K - Anton and Lines CodeForces - 593B

    K - Anton and Lines CodeForces - 593B 思路 求出两个边界处,每条线对应的 y,如果出现(y1i - y1j)* (y2i - y2j) < 0, 则相交 复 ...

  5. Soil Ecology Letters被ESCI收录

    2021年5月5日,Soil Ecology Letters 被Emerging Source Citation Index(ESCI)数据库正式收录.这是创刊1年多之后,本刊入选的又一国际重要数据库 ...

  6. Ecology Letters:重金属的污染可导致铁载体生产菌的增加

    本文转载自"美格基因",已获授权 (图片来源于网络) 推荐指数:★★★★ 阅读时间:4分钟 文本字数:1561 重金属的污染可导致铁载体生产菌的增加 Ecological sele ...

  7. LeetCode:917. Reverse Only Letters

    051201 题目 Given a string S, return the "reversed" string where all characters that are not ...

  8. Codeforces Round #324 (Div. 2) E. Anton and Ira 贪心

    E. Anton and Ira Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/probl ...

  9. LETTers比赛第三场 --1003 大明A+B解题报告

    报告人:侯建鹏 报告日期:2012/4/16 1003 大明A+B 解题思路:模拟 我的方法很简单,就是不停的模拟.模拟.再模拟. 首先,把每个数都分成两部分,整数部分和小数部分,即a_h_count ...

最新文章

  1. jdbc与hibernate的优缺点比较
  2. linux 安装删除命令,Linux如何使用命令行卸载安装包
  3. latex教程详细笔记
  4. @Autowired注入了dao,为什么还要写getDao(){return userDao}这个方法?有什么作用?
  5. 手机型号大全资料_电子元器件知识资料大全
  6. js实现的简单模态对话框
  7. java字符串的常量池
  8. Mysql多表查询(两张独立表,一张关系表)
  9. MySQL group_concat()函数
  10. [AH/HNOI2017]大佬
  11. Xcode LaunchImage 载入界面大小设置
  12. 第13课 智商问题 《小学生C++趣味编程》
  13. cmder 基本配置和使用
  14. FSK软件鉴频,输出串行基带数据信号
  15. 微生物组-扩增子16S分析第10期(报名直播课免费参加线下2020.10)
  16. Kubernetes 健康状态检查(九)
  17. 用MySQL绘制新年祝福图形_2020年春节,你有哪些与众不同的祝福语?
  18. 智能优化算法之灰狼优化算法(GWO)的实现(Python附源码)
  19. 设计模式(四)行为型模式介绍及实例(上)
  20. 2022数学建模国赛如何安排进度?川川学长精心讲解

热门文章

  1. VC遍历INI配置文件
  2. 全国计算机二级等级考试2017,2017年全国计算机二级考试科目及内容
  3. 9张逻辑思维图,迅速提升你的工作能力
  4. All The Elements Pronounced in Order (American English)
  5. 计算机访问记录怎么查,电脑上微信有访客记录吗?我们要怎么查看访客?
  6. dataTables -- ajax 分页基本使用
  7. 这几点技巧可提高 Kindle 使用体验
  8. java返回一个布尔值_关于java:返回布尔值的方法
  9. LoRA转4G及网关中继器工作原理
  10. 【目标流畅阅读文献_语法篇】1.3简单句_动词时态