以下程序的输出结果是 ( ) 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 7B.tuesday=2 sunday=7;tuesday=9 sunday=3;1 2 3 4 5 6 7C.tuesday=0 sunday=7;tuesday=2 sunday=3;1 2 3 4 5 6 7D.tuesday=1 sunday=2;tuesday=3 sunday=4;1 2 3 4 5 6 7

以下程序的输出结果是 ( ) 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


相关考题:

有变量定义如下: type weekday=(mon,tue,wed,thu,fri,sat,sun); workday=mon..fri; var day1:weekday; day2:workday; 下列不正确的语句是( )。 Aday1:=wedBday2:=wedCday1:=day2Dday2:=sun

有以下程序fun(char p[][10]){ int n=0,i;for(i=0;i7;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)1B)2C)3D)0

有以下程序 fun(char p[][10]) {int n=0,i; for(i=O;i<7;i++) if(p[i][O]=T)n++; return n; } main() {char str[][10]={"Mon","Tue","Wed","Thu","Fri", "Sat","Sun"}; printf("%d\n",fun(str)); }A.1B.2C.3D.0

有以下程序:include fun( char p[] [10]){int n=0,i; for(i=0;i 有以下程序:#include <stdio.h>fun( char p[] [10]){ int n=0,i; for(i=0;i<7;i ++) if(p[i][0] =='T') n++; return n;}main( ){ char sir[] [10] = { "Mon" ,"Tue" ,"Wed" ,"Thu" ,"Fri" ,"Sat" ,"Sun" }; prlnff(" % d\n" ,fun(str) );}程序执行后的输出结果是( )。A.1B.2C.3D.0

有以下程序: 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.1B.2C.3D.0

输入数字1-7,输出对应的星期的英文名,分别是MON、TUE、WED、THU、FRI、SAT、SUN,如果输入的不是数字1-7,则提示“请输入数字1-7”。

6、在C#中,下列代码的输出结果是()。 class Test { public enum WeekDays { Mon, Tue, Wed, Thur, Fri, Sta, Sun } static void Main() { WeekDays week = (WeekDays)2; Console.WriteLine(week); } }

有如下枚举类型变量的定义: enum week_day{Wed=3,Thu,Fri,Sat,Sun,Mon,Tue}everyday; 则Mon的值为______。A.1B.2C.8D.5

【填空题】如有定义的枚举类型: enum week_day{Wed=3,Thu,Fri,Sat,Sun,Mon,Tue}everyday; 则,Mon的值为______。