POJ 2608
#include<iostream>
#include<stdio.h>
#include<string>
#include<set>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
set<char> coll[]; coll[].insert('B');
coll[].insert('F');
coll[].insert('P');
coll[].insert('V'); coll[].insert('C');
coll[].insert('G');
coll[].insert('J');
coll[].insert('K');
coll[].insert('Q');
coll[].insert('S');
coll[].insert('X');
coll[].insert('Z'); coll[].insert('D');
coll[].insert('T'); coll[].insert('L'); coll[].insert('M');
coll[].insert('N'); coll[].insert('R');
int i;
int j;
int tem;
string s;
//set<char>::iterator pos;
while(cin>>s)
{
tem = -;
for(i = ; i < s.length(); ++i)
{
for(j = ; j <= ; ++j)
{
if(coll[j].find(s[i]) != coll[j].end())
{
if(tem != j)
{
cout<<j;
tem = j;
}
break;
} }
if(j == )
tem = -;
}
cout<<endl;
} }
POJ 2608的更多相关文章
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
- poj 2352 Stars 数星星 详解
题目: poj 2352 Stars 数星星 题意:已知n个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...
随机推荐
- sqlserver2008查询性能优化(文摘)
第1章 sql查询性能调整 第4章 索引分析
- main.cpp
/*main.cpp * *The starting point of the network simulator *-Include all network header files *-initi ...
- mysql only_full_group_by报错的问题(转)
原文:https://www.cnblogs.com/jim2016/p/6322703.html 在mysql 工具 搜索或者插入数据时报下面错误: ERROR 1055 (42000): Expr ...
- C++STL deque
deque双端数组 deque<int> dq; deque<int>::iterator it; dq.push_back();//尾部插入元素 dq.push_front( ...
- 强大的DataGrid组件[1]
说明:DataGrid组件是Silverlight数据组件中最为常用并且是功能最为强大的数据组件.因此,对开发者而言,深入了解其特性是十分有必要的.本文先介绍该组件的基本特性,接着通过几个简单实例来说 ...
- JSP动作元素<jsp:include>和<jsp:param>的搭配使用
最近开发项目中广告头的优化:引入了<jsp:include page="XX.jsp"></jsp:include> 当<jsp:include> ...
- Codeforces Round #535 (Div. 3) 1108C - Nice Garland
#include <bits/stdc++.h> using namespace std; int main() { #ifdef _DEBUG freopen("input.t ...
- PAT甲级 1122. Hamiltonian Cycle (25)
1122. Hamiltonian Cycle (25) 时间限制 300 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The ...
- shell工具-awk
awk 一个强大的文本分析工具,把文件逐行的读入,以空格为默认分隔符将每行切片,切开的部分再进行分析处理. 基本用法 awk [选项参数] 'pattern1{action} pattern2{act ...
- AngularJS $scope 继承性 作用 生命周期
一.基本概念 作用域是一个指向应用模型的对象,相当于MVVM中的ViewModel,能绑定数据(属性)和行为(方法),能监控表达式和传递事件,是实现双向绑定的基础,是应用在 HTML (视图) 和 J ...