亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      自考

      各地資訊
      當(dāng)前位置:考試網(wǎng) >> 自學(xué)考試 >> 自考真題 >> 工學(xué)類 >> 計算機(jī)基礎(chǔ)與程序設(shè)計 >> 文章內(nèi)容

      排行熱點(diǎn)

      • 歷年真題
      • 模擬試題
      • 自考自答

      全國2010年7月自學(xué)考試計算機(jī)基礎(chǔ)與程序設(shè)計試題_第6頁

      來源:考試網(wǎng) [ 2013年12月26日 ] 【大 中 小】

      四、閱讀分析題 (本大題共6小題,每小題5分,共30)

      30.寫出下列程序的運(yùn)行結(jié)果。

       main()

       {    int a=10,b=8,c;

      c=a;

      a=b;

      b=c;

      printf(″a=%d,b=%d\n″,a,b);

        }

      31.寫出下面程序的功能;如果輸入6和9,寫出程序的輸出結(jié)果。

       main()

       {    int a,b,x,y;

      scanf(″%d%d″,&a,&b);

            x=a*a+b*b;

      if(x>100)

       {y=x/100;printf(″%d″,y);}

       else

       printf(″%d″,a+b);

       }

      32.寫出下面程序的功能及運(yùn)行結(jié)果。

       main()

       {

       int n=1,sum=0;

       do{

       sum=sum+n;

       n+=2;

       }while(n<100);

       printf(″sum=%d\n″,sum);

       }

      33.寫出下面程序的功能和運(yùn)行結(jié)果。

       int fun(int a[][4])

       {     int i,j,k,tem

       tem=a[0][0];

       for(I=0;i<3;i++)

       for(j=0;j<4;j++)

       if(a[i][j]<tem)tem=a[i][j];

       return(tem);

       }

       main()

       {    int b[3][4]={{1,3,-5,7},{2,4,-6,8},{10,20,-30,40}};

      printf(″%d\n″,fun(b));

       }

      34.下列程序中字符串中各單詞之間有一個空格,寫出程序的輸出結(jié)果。

       #include <string.h>

       #include <stdio.h>

       main()

       {    char str1[]=″How do you do″;

      puts(str1);

      strcpy(str1+str1en(str1)/2,″es she″);

      printf(″%s\n″,str1);

       }

      35.寫出下列程序的功能和運(yùn)行結(jié)果。

       #include <stdio.h>

       reverse (char *s)

       {     char*t,ch;

       for(t=s+strlen(s)-1;s<t;s++,t--)

       {ch=*s;*s=*t;*t=ch;}

       }

       main()

       {   char*s1=″123456″;

       reverse(s1);

       printf(″%s\n″,s1);

       }

      五、編程題 (本大題共2小題,每小題12分,共24)

      36.編程求20至100之間素數(shù)的累加和并輸出該累加和。

      37.編程生成以下A、B兩個數(shù)組(不得使用輸入語句輸入數(shù)據(jù)或?qū)?shù)組初始化),將兩數(shù)組對應(yīng)元素相加寫入C數(shù)組中,最后并排輸出A、B、C三個數(shù)組。

                

      首頁 1 2 3 4 5 6 尾頁
      責(zé)編:may1205