WEB开发网
开发学院软件开发Shell 输入一个汉字转为该汉字拼音的源程序 阅读

输入一个汉字转为该汉字拼音的源程序

 2009-06-30 04:43:00 来源:WEB开发网   
核心提示:/* * Source : hz.c * Version: 1.0 * Description: 将汉字转为拼音 * Interface : * * * History: * Date Postion Author Description * -- * 2004.05.20 NanJing 吴宇明 Create */

  /*
  * Source : hz.c
  * Version: 1.0
  * Description: 将汉字转为拼音
  * Interface :
  *
  *
  * History:
  * Date Postion Author Description
  * ------------------------------------------------------------------
  * 2004.05.20 NanJing 吴宇明 Create
  */
  
  #include <stdio.h>
  #define ROW_CNT 396
  long wu_get_asc(char *str)
  {
  long l;
  char str_tmp[11];
  
  memset(str_tmp,0,sizeof(str_tmp));
  str_tmp[0]=str[1];
  str_tmp[1]=str[0];
  l=*(long*)str_tmp;
  l=l-65536;
  
  /*
  printf("%ld\n",l);
  printf("%d\n",str_tmp[0]);
  printf("%d\n",str_tmp[1]);
  */
  return l;
  }
  
  void main(int argc,char *argv[])
  {
  //共396行
  char *py[]=
  {
  "a" ,
  "ai" ,
  "an" ,
  "ang" ,
  "ao" ,
  "ba" ,
  "bai" ,
  "ban" ,
  "bang" ,
  "bao" ,
  "bei" ,
  "ben" ,
  "beng" ,
  "bi" ,
  "bian" ,
  "biao" ,
  "bie" ,
  "bin" ,
  "bing" ,
  "bo" ,
  "bu" ,
  "ca" ,
  "cai" ,
  "can" ,
  "cang" ,
  "cao" ,
  "ce" ,
  "ceng" ,
  "cha" ,
  "chai" ,
  "chan" ,
  "chang" ,
  "chao" ,
  "che" ,
  "chen" ,
  "cheng" ,
  "chi" ,
  "chong" ,
  "chou" ,
  "chu" ,
  "chuai" ,
  "chuan" ,
  "chuang" ,
  "chui" ,
  "chun" ,
  "chuo" ,
  "ci" ,
  "cong" ,
  "cou" ,
  "cu" ,
  "cuan" ,
  "cui" ,
  "cun" ,
  "cuo" ,
  "da" ,
  "dai" ,
  "dan" ,
  "dang" ,
  "dao" ,
  "de" ,
  "deng" ,
  "di" ,
  "dian" ,
  "diao" ,
  "die" ,
  "ding" ,
  "diu" ,
  "dong" ,
  "dou" ,
  "du" ,
  "duan" ,
  "dui" ,
  "dun" ,
  "duo" ,
  "e" ,
  "en" ,
  "er" ,
  "fa" ,
  "fan" ,
  "fang" ,
  "fei" ,
  "fen" ,
  "feng" ,
  "fo" ,
  "fou" ,
  "fu" ,
  "ga" ,
  "gai" ,
  "gan" ,
  "gang" ,
  "gao" ,
  "ge" ,
  "gei" ,
  "gen" ,
  "geng" ,
  "gong" ,
  "gou" ,
  "gu" ,
  "gua" ,
  "guai" ,
  "guan" ,
  "guang" ,
  "gui" ,
  "gun" ,
  "guo" ,
  "ha" ,
  "hai" ,
  "han" ,
  "hang" ,
  "hao" ,
  "he" ,
  "hei" ,
  "hen" ,
  "heng" ,
  "hong" ,
  "hou" ,
  "hu" ,
  "hua" ,
  "huai" ,
  "huan" ,
  "huang" ,
  "hui" ,
  "hun" ,
  "huo" ,
  "ji" ,
  "jia" ,
  "jian" ,
  "jiang" ,
  "jiao" ,
  "jie" ,
  "jin" ,
  "jing" ,
  "jiong" ,
  "jiu" ,
  "ju" ,
  "juan" ,
  "jue" ,
  "jun" ,
  "ka" ,
  "kai" ,
  "kan" ,
  "kang" ,
  "kao" ,
  "ke" ,
  "ken" ,
  "keng" ,
  "kong" ,
  "kou" ,
  "ku" ,
  "kua" ,
  "kuai" ,
  "kuan" ,
  "kuang" ,
  "kui" ,
  "kun" ,
  "kuo" ,
  "la" ,
  "lai" ,
  "lan" ,
  "lang" ,
  "lao" ,
  "le" ,
  "lei" ,
  "leng" ,
  "li" ,
  "lia" ,
  "lian" ,
  "liang" ,
  "liao" ,
  "lie" ,
  "lin" ,
  "ling" ,
  "liu" ,
  "long" ,
  "lou" ,
  "lu" ,
  "lv" ,
  "luan" ,
  "lue" ,
  "lun" ,
  "luo" ,
  "ma" ,
  "mai" ,
  "man" ,
  "mang" ,
  "mao" ,
  "me" ,
  "mei" ,
  "men" ,
  "meng" ,
  "mi" ,
  "mian" ,
  "miao" ,
  "mie" ,
  "min" ,
  "ming" ,
  "miu" ,
  "mo" ,
  "mou" ,
  "mu" ,
  "na" ,
  "nai" ,
  "nan" ,
  "nang" ,
  "nao" ,
  "ne" ,
  "nei" ,
  "nen" ,
  "neng" ,
  "ni" ,
  "nian" ,
  "niang" ,
  "niao" ,
  "nie" ,
  "nin" ,
  "ning" ,
  "niu" ,
  "nong" ,
  "nu" ,
  "nv" ,
  "nuan" ,
  "nue" ,
  "nuo" ,
  "o" ,
  "ou" ,
  "pa" ,
  "pai" ,
  "pan" ,
  "pang" ,
  "pao" ,
  "pei" ,
  "pen" ,
  "peng" ,
  "pi" ,
  "pian" ,
  "piao" ,
  "pie" ,
  "pin" ,
  "ping" ,
  "po" ,
  "pu" ,
  "qi" ,
  "qia" ,
  "qian" ,
  "qiang" ,
  "qiao" ,
  "qie" ,
  "qin" ,
  "qing" ,
  "qiong" ,
  "qiu" ,
  "qu" ,
  "quan" ,
  "que" ,
  "qun" ,
  "ran" ,
  "rang" ,
  "rao" ,
  "re" ,
  "ren" ,
  "reng" ,
  "ri" ,
  "rong" ,
  "rou" ,
  "ru" ,
  "ruan" ,
  "rui" ,
  "run" ,
  "ruo" ,
  "sa" ,
  "sai" ,
  "san" ,
  "sang" ,
  "sao" ,
  "se" ,
  "sen" ,
  "seng" ,
  "sha" ,
  "shai" ,
  "shan" ,
  "shang" ,
  "shao" ,
  "she" ,
  "shen" ,
  "sheng" ,
  "shi" ,
  "shou" ,
  "shu" ,
  "shua" ,
  "shuai" ,
  "shuan" ,
  "shuang" ,
  "shui" ,
  "shun" ,
  "shuo" ,
  "si" ,
  "song" ,
  "sou" ,
  "su" ,
  "suan" ,
  "sui" ,
  "sun" ,
  "suo" ,
  "ta" ,
  "tai" ,
  "tan" ,
  "tang" ,
  "tao" ,
  "te" ,
  "teng" ,
  "ti" ,
  "tian" ,
  "tiao" ,
  "tie" ,
  "ting" ,
  "tong" ,
  "tou" ,
  "tu" ,
  "tuan" ,
  "tui" ,
  "tun" ,
  "tuo" ,
  "wa" ,
  "wai" ,
  "wan" ,
  "wang" ,
  "wei" ,
  "wen" ,
  "weng" ,
  "wo" ,
  "wu" ,
  "xi" ,
  "xia" ,
  "xian" ,
  "xiang" ,
  "xiao" ,
  "xie" ,
  "xin" ,
  "xing" ,
  "xiong" ,
  "xiu" ,
  "xu" ,
  "xuan" ,
  "xue" ,
  "xun" ,
  "ya" ,
  "yan" ,
  "yang" ,
  "yao" ,
  "ye" ,
  "yi" ,
  "yin" ,
  "ying" ,
  "yo" ,
  "yong" ,
  "you" ,
  "yu" ,
  "yuan" ,
  "yue" ,
  "yun" ,
  "za" ,
  "zai" ,
  "zan" ,
  "zang" ,
  "zao" ,
  "ze" ,
  "zei" ,
  "zen" ,
  "zeng" ,
  "zha" ,
  "zhai" ,
  "zhan" ,
  "zhang" ,
  "zhao" ,
  "zhe" ,
  "zhen" ,
  "zheng" ,
  "zhi" ,
  "zhong" ,
  "zhou" ,
  "zhu" ,
  "zhua" ,
  "zhuai" ,
  "zhuan" ,
  "zhuang" ,
  "zhui" ,
  "zhun" ,
  "zhuo" ,
  "zi" ,
  "zong" ,
  "zou" ,
  "zu" ,
  "zuan" ,
  "zui" ,
  "zun" ,
  "zuo"
  };
  long py_code[]=
  {
  -20319 ,
  -20317 ,
  -20304 ,
  -20295 ,
  -20292 ,
  -20283 ,
  -20265 ,
  -20257 ,
  -20242 ,
  -20230 ,
  -20051 ,
  -20036 ,
  -20032 ,
  -20026 ,
  -20002 ,
  -19990 ,
  -19986 ,
  -19982 ,
  -19976 ,
  -19805 ,
  -19784 ,
  -19775 ,
  -19774 ,
  -19763 ,
  -19756 ,
  -19751 ,
  -19746 ,
  -19741 ,
  -19739 ,
  -19728 ,
  -19725 ,
  -19715 ,
  -19540 ,
  -19531 ,
  -19525 ,
  -19515 ,
  -19500 , <

Tags:输入 一个 汉字

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接