codeforces——443A——Anton and Letters
来源:互联网 发布:vscode js代码高亮 编辑:程序博客网 时间:2024/06/05 03:46
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<stdio.h>#include<iostream>#include<algorithm>#include<cmath>#include<cstring>using namespace std;int func1(int a,int b);int main(){ char c; while(~scanf("%c",&c)) { int a[26]; memset(a,0,sizeof(a)); while(1) { c=getchar(); if(c=='}') { getchar(); break; } a[c-97]=1; c=getchar(); getchar(); if(c=='}') break; } int ans=0; for(int i=0; i<26; i++) if(a[i]==1) ans++; cout<<ans<<endl; } return 0;}
- codeforces——443A——Anton and Letters
- Codeforces 443A Anton and Letters(水题)
- CodeForces 443A Anton and Letters
- CodeForces 443A Anton and Letters
- 443A - Anton and Letters
- Codeforces Anton and Letters
- A. Anton and Letters
- codeforces——734A——Anton and Danik
- Codeforces Round #253 (Div. 2)A. Anton and Letters
- Codeforces Round #253 (Div. 2) A. Anton and Letters
- CF 253A. Anton and Letters
- A. Anton and Letters Codeforces Round #253 (Div. 2) set 应用
- cf443A Anton and Letters
- Anton and Letters
- Anton and Letters - CF#253 (Div. 2)A (443A) 大水
- 组合数学——Codeforces Round #404 (Div. 2) D. Anton and School
- Codeforces Round #379 (Div. 2) C. Anton and Making Potions —— 二分
- Codeforces Round #379 (Div. 2) D. Anton and Chess —— 基础题
- fileparts函数
- 用sort去按属性排序数组
- 南阳oj 题目42 一笔画问题
- 去掉标题和沉寂模式
- Python操作数据库
- codeforces——443A——Anton and Letters
- Java虚拟机之垃圾收集算法
- 喜欢的书籍列表
- bzoj1537
- Struts2_动态方法调用和使用通配符定义action
- UESTC 1595 老司机的毒奶 贪心+二叉树+优先队列
- Android-Android 的消息机制
- java反射浅析
- Linux下安装Zookeeper