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个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...
随机推荐
- 2018.11.01 NOIP训练 图论(线段树+倍增+dfs序)
传送门 一道挺妙的题. 对于询问点(u,v),如右图所示,我们可以发现存在一个点m在u->v的路径中,m子树的点到u是最近的,m子树外到v是最近的.其中dis(u,m)=(dis(u,v)-1) ...
- java常用设计模式八:代理模式
一.概述 代理模式是指客户端并不直接调用实际的对象,而是通过调用代理,来间接的调用实际的对象. 其特征是代理类与委托类有同样的接口,真正的核心业务逻辑还是在实际对象里面. 二.为什么要使用代理模式 当 ...
- 以太坊虚拟机(EVM)
转载链接:https://ethfans.org/posts/solidity-chapter1-introduciton-to-smart-contracts 概括总览: 以太坊虚拟机(EVM)是以 ...
- JAVA经典算法40+
现在是3月份,也是每年开年企业公司招聘的高峰期,同时有许多的朋友也出来找工作.现在的招聘他们有时会给你出一套面试题或者智力测试题,也有的直接让你上机操作,写一段程序.算法的计算不乏出现,基于这个原因我 ...
- html的那些小小细节
1.get post方式提交的不同 get:数据放在url的后面,用?连接 会在客户端保留缓存信息,不安全 ...
- Docker Compose部署lnmp
参考:https://github.com/micooz/docker-lnmp 一.简介 使用Dcoekr镜像部署lnmp(Linux.Nginx.MySQL.PHP7). 1.1 结构 app └ ...
- Ubuntu Remove Mysql.service in Systemctl
After installing MySQL 5.7, I do not want to start MySQL via systemctl. It's unconvenient and compli ...
- Java数据库技术
JDBC即Java数据库连接 是接口,用于执行SQL语句,包含Java写的类和界面.几乎可以把SQL传给任何数据库,不用单独编写SQL. 用处,1是与数据库建立连接,2是向数据库发送S ...
- 20169207《Linux内核原理与分析》第十周作业
这周除了阅读学习教材「Linux内核设计与实现 (Linux Kernel Development)」第教材第15,16章外.我们还需要接着完成学习MOOC「Linux内核分析」第八讲「Linux系统 ...
- java实现在图片上编辑文本内容
package com.yin.text; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; impor ...