用C++编写一程序,输入数字输出星期几,如输入数字“1”输出“Mon”, 输入数字“2”输出“Tues”,…, 输入数字“7”输出“Sun”
这道题目可以用其它的方法去做,我是利用指针数组来编写实现这个题目代码如下#includeusingnamespacestd;intmain(){inti;char*week[]={"Mon","Tues","Wed","Thurs","Fri","Sat","Sun"};//初始化指针数组cout>i;while(i7){cout>i;}cout<<*(week+i-1);return0;}这是一