分类：电脑/网络-程序设计
问题：救命啊..帮我些个C++程序吧.感谢大神!英语原文:Writea 
原文:Write  a program that translates a alphabetic phone number into numeric form:Enter phone number: CALLATT (in case you don’t have a telephone nearby, here are the letters on keys: 2=ABC, 3=DEF, 4=GHI, 5=JKL, 6=MNO, 7=PRS, 8=TUV, 9=WXY.) If the original phone numbers con原文:Write  a program that translates a alphabetic phone number into numeric form:Enter phone number: CALLATT (in case you don’t have a telephone nearby, here are the letters on keys: 2=ABC, 3=DEF, 4=GHI, 5=JKL, 6=MNO, 7=PRS, 8=TUV, 9=WXY.) If the original phone numbers contains nonealphabetic characters (digit or punctuation, for example), leave them unchanged:Enter phone number: 1-800-COL-LECT1-800-265-5328You may assume that any letters entered by user are upper case.翻译中文:　　写一个程序翻译成数字形式的字母的电话号码。　　　　CALLATT输入的电话号码:　　 　　(在你没有电话旁边,这里是字母键:2是ABC,3是DEF、4是GHI, 5是JKL, 6是MNO, 7是PRS, 8是TUV, 9是WXY.)如果原始的电话号码(或nonealphabetic含标点符号,例如),让他们保持不变。　　例如:    1-800-COL-LECT输入的电话号码:　　1-800-265-5328　　用户输入的要是大写字母。
回答：char szSrc[]="1-800-COL-LECT";
char *p = szSrc;
while(*p)
{
    if((*p >= 'A') && (*p <= 'Y'))
        *p =  2 + (*p - 'A')/3;
}
printf("%s", szSrc);/*即输出1-800-265-5328 */