---
title: "POJ_1002_487-3279分析"
author: "linx_bupt"
date: "2011-09-06T09:06:07Z"
tags: []
categories: ["编程语言"]
slug: "poj-1002-487-3279"
draft: false
lastmod: "2011-09-06T09:06:07Z"
id: 1166271
url: "https://simlelin.iteye.com/blog/1166271"
---

**POJ\_1002\_487-3279分析**

映射问题。规则简化如下，输入为除QZ外任意的大写英文字母（\[A-Z^\[QZ]]）或阿拉伯数字（1-9）或连字符（-）。

大写字母映射到阿拉伯数字的规则为：

A, B, and C map to 2  
D, E, and F map to 3  
G, H, and I map to 4  
J, K, and L map to 5  
M, N, and O map to 6  
P, R, and S map to 7  
T, U, and V map to 8  
W, X, and Y map to 9

连字符没有任何意义，可以忽略。标准输出形式如下：

310-1010，即3+4的形式，英文字母根据映射关系转化为数字。用用switch...case...即可轻松完成。