A. Anton and Letters
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard 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.

Sample test(s)
input
{a, b, c}
output
3
input
{b, a, b, a}
output
2
input
{}
output
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的更多相关文章

  1. Anton and Letters

    Anton and Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  2. A. Anton and Letters

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  3. Y - Anton and Letters

    Problem description Recently, Anton has found a set. The set consists of small English letters. Anto ...

  4. Codeforces Round #253 (Div. 2) A. Anton and Letters

    题目很简单,只需要注意带空格的输入用getline即可 #include <iostream> #include <vector> #include <algorithm ...

  5. Codeforces Round 253 (Div. 2)

    layout: post title: Codeforces Round 253 (Div. 2) author: "luowentaoaa" catalog: true tags ...

  6. 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 ...

  7. C - Anton and Danik

    Problem description Anton likes to play chess, and so does his friend Danik. Once they have played n ...

  8. 【77.39%】【codeforces 734A】Anton and Danik

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  9. [LeetCode] Remove Duplicate Letters 移除重复字母

    Given a string which contains only lowercase letters, remove duplicate letters so that every letter ...

随机推荐

  1. 创建多模块maven项目

    有两种方式: 1,new -->maven project-->maven-archetype-quickstart 建完多个独立的project后,手动修改pom文件的packing类型 ...

  2. 2017年开年的第一次比较大的安全事件: MongoDB “赎金事件”,如何看待互联网安全问题

    今天上午(2017年1月7日),我的微信群中同时出现了两个MongoDB被黑掉要赎金的情况,于是在调查过程中,发现了这个事件.这个事件应该是2017年开年的第一次比较大的安全事件吧,发现国内居然没有什 ...

  3. 【顽固BUG】Visual Studio 2013 + TestDriven.NET-3.8.2860_Personal_Beta 调用的目标发生了异常。

    前言 突然怎么弄也无法断点调试了 输出如下: ------ Test started: Assembly: Server5.V2.dll ------ 调用的目标发生了异常. 而且网站运行提示: -- ...

  4. java 存储oracle的clob字段

    项目中有很长的字符创需要存储,用到了oracle的clob字段,直接很长的字符串插入到clob字段中会报字符过长的异常,于是便寻求解决方案.看到这个博客写的还不错 首先,创建一个含CLOB字段的表: ...

  5. c\c++复习基础要点08--c++单例模式

    单例模式有许多种实现方法,在c++中,甚至可以直接用一个全局变量做到这一点,但是这样的代码显得不优雅.使用全局对象能够保证方便地访问实例,但是不能保证只声明一个对象——也就是说除了一个全局实例外,仍然 ...

  6. Jenkins - 持续集成

    Jenkins是一个开源软件项目,旨在提供一个开放易用的软件平台,使持续集成变成可能. Jenkins,之前叫做Hudson,是基于Java开发的一种持续集成工具,用于监控秩序重复的工作,包括: 1. ...

  7. log4net根据日志类型写入到不同的文件中

    <?xml version="1.0"?> <configuration> <configSections> <!--log4net配置安 ...

  8. WPF资源字典使用

    资源字典出现的初衷就在于可以实现多个项目之间的共享资源,资源字典只是一个简单的XAML文档,该文档除了存储希望使用的资源之外,不做任何其它的事情. 1.  创建资源字典 创建资源字典的过程比较简单,只 ...

  9. (转)弹出窗口lhgDialog API文档

    应用到你的项目 如果您使用独立版本的lhgDialog窗口组件,您只需在页面head中引入lhgcore.lhgdialog.min.js文件,4.1.1+版本做了修改可以和jQuerya库同时引用, ...

  10. 生成getter()、setter()方法去掉变量前缀

    当定义的变量名有前缀但是不想在生成它的getter()和setter方法的时候让前缀出现,比如今天项目的部分代码: public class Crime { private UUID mId; //标 ...