cf443A Anton and Letters
来源:互联网 发布:2018淘宝活动时间大全 编辑:程序博客网 时间:2024/06/04 19:07
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.
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.
Print a single number — the number of distinct letters in Anton's set.
{a, b, c}
3
{b, a, b, a}
2
{}
0
模拟没什么可说的
#include<iostream>#include<cstdio>#include<cstring>#include<cstdlib>#include<cmath>#include<algorithm>using namespace std;bool mark[27];int ans;int main(){ char ch; while (1) { while ((ch!='}')&&(ch<'a'||ch>'z')) scanf("%c",&ch); if (ch=='}') break; if (!mark[ch-'a']) { mark[ch-'a']=1; ans++; } ch=' '; } printf("%d",ans);}
- cf443A Anton and Letters
- A. Anton and Letters
- Anton and Letters
- Codeforces Anton and Letters
- 443A - Anton and Letters
- Codeforces 443A Anton and Letters(水题)
- CodeForces 443A Anton and Letters
- CodeForces 443A Anton and Letters
- CF 253A. Anton and Letters
- Codeforces Round #253 (Div. 2)A. Anton and Letters
- Codeforces Round #253 (Div. 2) A. Anton and Letters
- codeforces——443A——Anton and Letters
- Anton and Letters - CF#253 (Div. 2)A (443A) 大水
- A. Anton and Letters Codeforces Round #253 (Div. 2) set 应用
- Codeforces593B. Anton and Lines
- A. Anton and Danik
- B. Anton and Digits
- Anton and Classes
- 浅谈三层架构
- RK3188(radxa rock )recovery模式升级
- 苹果新的编程语言 Swift 语言进阶(十四)--扩展
- [OpenGL]环境搭建以及OpenGL初识
- 学生信息管理系统(一)——系统功能分析
- cf443A Anton and Letters
- 6-20笔试记录
- 检查重复的类
- Python基础-Python:locals 和 globals
- 黑马程序员-java就业面试题大全(持续更新)
- Swift 子脚本(十一)
- __bridge,__bridge_transfer和__bridge_retained详解
- 无法向会话状态服务器发出会话状态请求请。确保 ASP.NET State Service (ASP.NET 状态服务)已启动
- GIS开源程序收集