下列程序的运行结果为【 】。 enum weekday {sun=7,mon=1,tue,wed, thu, fri,sat}; main ( ) { enum weekday workday,week end;

admin2009-01-15  18

问题 下列程序的运行结果为【  】。
    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;
       printf ("\ntueday=%d sunday=%d; ",workday, week_end);
       workday=sun+tue;
       week_end= (enum weekday)3;
       printf ("tueday=%d sunday=%d; ",workday, weekend);
       a [sun]=sun;
       a [mon]=mon;
       a [tue]=rue;
       a [wed]=wed;
       a [thu]=thu;
       a [fri]=fri;
       a [sat]=sat;
       for(i=l;i<=7;i++) printf("%d ",a);
    }

选项

答案tueday=2 sunday=7;tueday=9 sunday=3;1 2 3 4 5 6 7

解析
转载请注明原文地址:https://jikaoti.com/ti/nxK0FFFM
0

相关试题推荐
最新回复(0)