以下程序的输出结果是 ( ) enum weekday {sun=7,mon=1,tue,wed,thu,fri,sat}; main( ) { enum weekday workday,week_end; int i,a [8]; workday=tue; week end=sun; pritnf("\ntuesday=%d sunday=%d", wotkday, week_end); workday=sun+tue; week_end=(enum weekday)3; printf ("tuesday=%d sunday=%d", workday week_end); a[sun]=sun; a[mon]=mon a[tue]=tue; a[wed]=wed; a[thu]=thu; a[fri]=fr; a[sat]=sat; for(i=1;i<7;i+ +) printf("%d",a [i]); }
A.tuesday=2 sunday=7;tuesday=2 sunday=7;1 2 3 4 5 6 7
B.tuesday=2 sunday=7;tuesday=9 sunday=3;1 2 3 4 5 6 7
C.tuesday=0 sunday=7;tuesday=2 sunday=3;1 2 3 4 5 6 7
D.tuesday=1 sunday=2;tuesday=3 sunday=4;1 2 3 4 5 6 7
第1题:
有以下程序: fun(char p[][10]) { int n=0,i; for(i=0;i<7;i++) if(P[i][0]=='T')n++; return n; } main() {char str[][10]={"Mon","Tue","wed","Thu","Fri","Sat","Sun"}; printf("%d\n",fun(str)); } 程序执行后的输出结果是( )。
A.1
B.2
C.3
D.0
第2题:
6、在C#中,下列代码的输出结果是()。 class Test { public enum WeekDays { Mon, Tue, Wed, Thur, Fri, Sta, Sun } static void Main() { WeekDays week = (WeekDays)2; Console.WriteLine(week); } }
第3题:
【填空题】如有定义的枚举类型: enum week_day{Wed=3,Thu,Fri,Sat,Sun,Mon,Tue}everyday; 则,Mon的值为______。
第4题:
输入数字1-7,输出对应的星期的英文名,分别是MON、TUE、WED、THU、FRI、SAT、SUN,如果输入的不是数字1-7,则提示“请输入数字1-7”。
第5题:
有如下枚举类型变量的定义: enum week_day{Wed=3,Thu,Fri,Sat,Sun,Mon,Tue}everyday; 则Mon的值为______。
A.1
B.2
C.8
D.5