为何不能输出中文?
看到一个求助帖子(代码如下),我试了一下,编译没有问题,就是没有输出,请教该如何处理,谢谢!程序代码:
#include<stdio.h> int main() { int myyear,tiangan,dizhi,shengxiao; wchar_t tiangan_list[21] = {'庚','辛','壬','癸','甲','乙','丙','丁','戊','己'},*p1[21]; wchar_t dizhi_list[25] = {'申','酉','戌','亥','子','丑','寅','卯','辰','巳','午','未'},*p2[25]; wchar_t shengxiao_list[25] = {'猴','鸡','狗','猪','鼠','牛','虎','兔','龙','蛇','马','羊'},*p3[25]; *p1 = tiangan_list; *p2 = dizhi_list; *p3 = shengxiao_list; scanf("%d",&myyear); // 输入你生日的年份 tiangan = myyear % 10; dizhi = myyear % 12; shengxiao = (myyear % 12); printf("%d 这一年的干支是:%c%c",myyear,*(*p1 + tiangan),*(*p2 + dizhi)); printf("生肖是属 %c\n",*(*p3 + shengxiao)); }
[此贴子已经被作者于2020-10-12 13:53编辑过]