100分求取汉字拼音首字母c++函数(100分)

  • 主题发起人 主题发起人 iwalk
  • 开始时间 开始时间
I

iwalk

Unregistered / Unconfirmed
GUEST, unregistred user!
100分求取汉字拼音首字母c++函数
 
我这里有个delphi的,代码太长了,把你的邮箱给我!
 
to 楼上:
谢谢,但我要c++builder的代码,delphi代码我有。
 
delphi代码你已经有了,难道还不会转换?
 
唉,怎知我没试过自己转呢?我就是没有转换成功撒,我对C++语法不是很熟耶。
多谢赐教,请继续。
 
不用转啊,在C++builder可直接用。
 
留下Email,我发给你吧(c++代码)
 
to linsb:
iwalk@sohu.com
谢谢
 
已发,查收。
 
to linsb:
收到,谢谢
不过我编译好像有点问题,我用的是c++builder6,请问您的代码能在这个环境下直接用吗?
——稍后结贴
 
已在c++builder6编译通过!
 
我没有可以给我一份么
pzoon@163.com
 
String __fastcall FirstLetterFromHZ(String strKey)
{
unsigned int uiChineseChar = 0;
unsigned char ucChar[3] = " ";
String strResult;
memcpy(ucChar, strKey.c_str(),2);
uiChineseChar = (ucChar[0] << 8) + ucChar[1];
if((uiChineseChar >= 0xB0A1) &amp;&amp;
(uiChineseChar <= 0xB0C4)) strResult = "A";
if((uiChineseChar >= 0xB0C5) &amp;&amp;
(uiChineseChar <= 0xB2C0)) strResult = "B";
if((uiChineseChar >= 0xB2C1) &amp;&amp;
(uiChineseChar <= 0xB4ED)) strResult = "C";
if((uiChineseChar >= 0xB4EE) &amp;&amp;
(uiChineseChar <= 0xB6E9)) strResult = "D";
if((uiChineseChar >= 0xB6EA) &amp;&amp;
(uiChineseChar <= 0xB7A1)) strResult = "E";
if((uiChineseChar >= 0xB7A2) &amp;&amp;
(uiChineseChar <= 0xB8C0)) strResult = "F";
if((uiChineseChar >= 0xB8C1) &amp;&amp;
(uiChineseChar <= 0xB9FD)) strResult = "G";
if((uiChineseChar >= 0xB9FE) &amp;&amp;
(uiChineseChar <= 0xBBF6)) strResult = "H";
if((uiChineseChar >= 0xBBF7) &amp;&amp;
(uiChineseChar <= 0xBFA5)) strResult = "J";
if((uiChineseChar >= 0xBFA6) &amp;&amp;
(uiChineseChar <= 0xC0AB)) strResult = "K";
if((uiChineseChar >= 0xC0AC) &amp;&amp;
(uiChineseChar <= 0xC2E7)) strResult = "L";
if((uiChineseChar >= 0xC2E8) &amp;&amp;
(uiChineseChar <= 0xC4C2)) strResult = "M";
if((uiChineseChar >= 0xC4C3) &amp;&amp;
(uiChineseChar <= 0xC5B5)) strResult = "N";
if((uiChineseChar >= 0xC5B6) &amp;&amp;
(uiChineseChar <= 0xC5BD)) strResult = "O";
if((uiChineseChar >= 0xC5BE) &amp;&amp;
(uiChineseChar <= 0xC6D9)) strResult = "P";
if((uiChineseChar >= 0xC6DA) &amp;&amp;
(uiChineseChar <= 0xC8BA)) strResult = "Q";
if((uiChineseChar >= 0xC8BB) &amp;&amp;
(uiChineseChar <= 0xC8F5)) strResult = "R";
if((uiChineseChar >= 0xC8F6) &amp;&amp;
(uiChineseChar <= 0xCBF9)) strResult = "S";
if((uiChineseChar >= 0xCBFA) &amp;&amp;
(uiChineseChar <= 0xCDD9)) strResult = "T";
if((uiChineseChar >= 0xCDDA) &amp;&amp;
(uiChineseChar <= 0xCEF3)) strResult = "W";
if((uiChineseChar >= 0xCEF4) &amp;&amp;
(uiChineseChar <= 0xD188)) strResult = "X";
if((uiChineseChar >= 0xD1B9) &amp;&amp;
(uiChineseChar <= 0xD4D0)) strResult = "Y";
if((uiChineseChar >= 0xD4D1) &amp;&amp;
(uiChineseChar <= 0xD7F9)) strResult = "Z";
return strResult;
}
 
能发一分给我吗?nasoft@sina.com
非常感谢!~
 
后退
顶部