小战帅哥吧 关注:9贴子:316

回复:下游戏没速度

取消只看楼主收藏回复


C)定义语句中的p只能存放double类型变量的地址
D) 定义语句中,*p=&a把变量a的地址作为初始值赋给指针变量p
  (29)若有定义语句int year=2009, *p=&year;以下不能使变量year中的值增至2010的语句是___A____ A)*p+=1; B)(*p)++; C)++(*p); D) *p++;
  (26)以下定义数组的语句错误的是___B____
A) int num[]={1,2,3,4,5,6}; B) int num[][3]={{1,2},3,4,5,6};
C) int num[2][4]={{1,2},{3,4},{5,6}}; D) int num[][4]={1,2,3,4,5,6};


IP属地:湖南40楼2012-12-18 03:18
回复
    (10)有以下程序
    #include <stdio.h>
    void fun(int *p)
    { printf("%d\n",p[5]); }
    main()
    { int a[10]={1,2,3,4,5,6,7,8,9,10};
      fun(&a[3]);
    }
      程序运行后的输出结果是___D____A)5 B)6 C)8 D) 9
    (11)有以下程序
    #include <stdio.h>
    #define N 4
    void fun(int a[][N], int b[])
    { int i;
    for(i=0;i<N;i++) b[i]=a[i][i]-a[i][N-1-i];
    }
    main()
    { int x[N][N]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}},y[N],i;


    IP属地:湖南41楼2012-12-18 03:18
    回复
      fun(x,y);
      for(i=0;i<N;i++) printf("%d",y[i]); printf("\n");
      }
      程序运行后的输出结果是_B_A)-12,-3,0.0, B)-3,-3,1,3 C)0,1,2,3 D)-3,-3,-3,-3
        (12)若有定义语句:char *s1="OK", *s2="ok";,以下选项中,能够输出"OK"的语句___D____A) if(strcmp(s1,s2)==0) puts(s1); B) if(strcmp(s1,s2)!=0) puts(s2);
      C) if(strcmp(s1,s2)==1) puts(s1); D) if(strcmp(s1,s2)!=0) puts(s1);
        (13)以下程序的主函数中调用了在其前面定义的fun函数


      IP属地:湖南42楼2012-12-18 03:18
      回复
        #include <stdio.h>

        main()
        { double a[15], k;
          k=fun(a);

        }
           则以下选项中错误的fun函数的首部___D____
        A) double fun( double a[15]) B) double fun( double *a)
        C) double fun( double a[]) D) double fun( double a)
        (14)有以下程序
        #include <stdio.h>
        int f(int m)
        { static int n=0;
        n+=m;
        return n;
        }
        main()
        { int n=0;
        printf("%d,",f (++n));


        IP属地:湖南43楼2012-12-18 03:18
        回复
          printf("%d\n",f (n++));
          }
             程序运行后的输出结果是__A_____A)1,2 B)1,1 C)2,3 D)3,3
          (15)有以下程序
          #include <stdio.h>
          main()
          { char ch[3][5]={ "AAAA","BBB","CC"};
          printf("%s\n",ch[1]);
          }
           程序运行后的输出结果是____D___A)AAAA B)CC C)BBBCC D)BBB


          IP属地:湖南44楼2012-12-18 03:18
          回复
            (16)有以下程序
            #include <stdio.h>
            main()
            { struct node { int n; struct node *next;} *p;
            struct node x[3]={{2, x+1},{4, x+2},{6, NULL}};
            p=x;
            printf("%d,",p->n);
            printf("%d,",p->next->n);
            }
              程序运行后的输出结果是_______A)2,3 B)2,4 C)3,4 D)4,6
            (17)有以下程序
            #include <stdio.h>
            main()
            { int a=2,b;
            b=a<<2; printf("%d,\n",b);


            IP属地:湖南45楼2012-12-18 03:18
            回复
              }
                程序运行后的输出结果是___D____A)2 B)4 C)6 D)8
              (18)以下选项中叙述错误的是___A____
              A)C语言函数中定义的赋有初值的静态变量,每调用一次函数,赋一次初值
              B)C程序的同一函数中,各复合语句内可以定义变量,其作用域仅限于本复合语句内
              C)C程序函数中定义的自动变量,系统不自动赋确定的初值
              D)C程序函数的形参不可以说明为ststic型变量
              二、填空题
              (1若程序中已给整型变量ab赋值1020,请写出按以下格式输出ab值的语句1】 。


              IP属地:湖南46楼2012-12-18 03:18
              回复
                ****a=10,b=20****
                  (2)以下程序运行后输出结果是2
                  #include <stdio.h>
                  main()
                  { int a=37;
                   a%=9; printf("%d\n",a);
                  }
                  (3) 以下程序运行后输出结果是3】。
                  #include <stdio.h>
                  main()
                 { int i,n[]={0,0,0,0,0};
                for(i=1;i<=2;i++)
                { n[i]=n[i-1]*3+1;
                printf("%d ",n[i]);
                }


                IP属地:湖南47楼2012-12-18 03:18
                回复
                  printf("\n");
                  }
                  (4)以下程序运行后的输出结果是
                    #include <stdio.h>
                    main()
                    { char a;
                     for(a=0;a<15;a+=5)
                     { putchar(a+'A'); }
                  printf("\n");
                    }
                  (5)以下程序运行后输出结果是5】。
                  #include <stdio.h>
                  void fun(int x)
                  { if(x/5>0) fun(x/5);
                   printf("\%dn",x);
                   }


                  IP属地:湖南48楼2012-12-18 03:18
                  回复
                    main()
                    { fun(11); printf("\n"); }
                    (6)有以下程序
                    #include <stdio.h>
                      main()
                      { int c[3]={0}, k ,i;
                    while((k=getchar()!='\n')
                    c[k-'A']++;
                    for(i=0;i<3;i++) printf("%d",c[i]); printf("\n");
                    }
                    若程序运行时从键盘输入ABCACC<回车>,则输出结果为6


                    IP属地:湖南49楼2012-12-18 03:18
                    回复