<s>请教_v 用_p 汉字_nz 替换_v 数字_n ，_w 写好_v 的_u 程序_n 不_d 知道_v 哪里_r 出_v 了_u 问题_n ，_w 求_v 指点_v</s>
<s>#_w include_nx "_w stdafx_nx ._w h_nx "_w #_q include_nx <_w stdio_nx ._w h_nx >_w #_q include_nx <_w std_nx lib_nx ._w h_nx >_w #_q include_nx <_w cstring_nx >_w #_q include_nx "_w locale_nx "_w /_w /_w 这个_r 头_m 文件_n 里_f 有_v setlocale_nx 函数_n void_n Convert_nx (_w wchar_nx __w t_nx *_w a_nx )_w ;_w int_nx main_nx (_w )_w {_w setlocale_nx (_w LC_nx __w ALL_v ,_w "_w chs_nx "_w )_w ;_w /_w /_w 设置_v 语言_n 为_v 中文_nz ，_w 否则_c 文件_n 中_f 存在_v 的_u 中文_nz 会_v 变成_v 乱码_n FILE_nx *_w fp_nx ;_w wchar_nx __w t_nx str_nx [_w 30_m ]_w ;_w char_nx *_w p_nx ;_w if_nx (_w (_w fp_nx =_w fopen_nx (_w "_w D_nx :_w \_w \_w file_nx __w test_nx ._w txt_n "_w ,_w "_w r_nx "_w )_w )_w =_w =_w NULL_nx )_w {_w /_w /_w 以_p 只读_v 打开_v printf_nx (_w "_w 打开_v 文件_n 失败_v !_w \_w n_nx "_w )_w ;_w exit_nx (_w 0_m )_w ;_w }_w fgetws_nx (_w str_nx ,_w 30_m ,_w fp_nx )_w ;_w for_v (_w int_nx i_nx =_w 0_m ;_w i_nx <_w 30_m ;_w i_nx +_w +_m )_w {_w if_nx (_w str_nx [_w i_nx ]_w >_w =_w 48_m &_w &_w str_nx [_w i_r ]_w <_w =_w 57_m )_w {_w Convert_nx (_w &_w str_nx [_w i_nx ]_w )_w ;_w }_w }_w fclose_nx (_w fp_nx )_w ;_w if_nx (_w (_w fp_nx =_w fopen_nx (_w "_w D_nx :_w \_w \_w file_nx __w test_nx ._w txt_nx "_w ,_w "_w w_nx "_w )_w )_w =_w =_w NULL_nx )_w {_w /_w /_w 以_p 只_d 写_v 打开_v printf_nx (_w "_w 打开_v 文件_n 失败_v !_w \_w n_nx "_w )_w ;_w exit_n (_w 0_m )_w ;_w }_w fw_nx printf_nx (_w fp_nx ,_w str_nx )_w ;_w fclose_nx (_w fp_nx )_w ;_w return_v 0_m ;_w }_w void_n Convert_n (_w wchar_nx __w t_n *_w a_m )_w {_w switch_nx (_w *_w a_nx )_w {_w case_n L_nx '_w 1_m '_w :_w *_w a_r =_w L_nx '_w 一_m '_w ;_w break_v ;_w case_n L_nx '_w 2_m '_w :_w *_w a_nx =_w L_nx '_w 二_m '_w ;_w break_v ;_w case_n L_r '_w 3_m '_w :_w *_w a_r =_w L_nx '_w 三_m '_w ;_w break_v ;_w case_n L_nx '_w 4_m '_w :_w *_w a_nx =_w L_nx '_w 四_m '_w ;_w break_v ;_w case_n L_nx '_w 5_m '_w :_w *_w a_r =_w L_nx '_w 五_m '_w ;_w break_v ;_w case_n L_r '_w 6_m '_w :_w *_w a_r =_w L_n '_w 六_m '_w ;_w break_v ;_w case_n L_nx '_w 7_m '_w :_w *_w a_nx =_w L_nx '_w 七_m '_w ;_w break_v ;_w case_n L_nx '_w 8_m '_w :_w *_w a_nx =_w L_nx '_w 八_m '_w ;_w break_v ;_w case_n L_nx '_w 9_m '_w :_w *_w a_r =_w L_nx '_w 九_m '_w ;_w break_nx ;_w }_w }_w</s>
