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

      自考

      各地資訊
      當前位置:華課網(wǎng)校 >> 自考 >> 自考真題 >> 工學類 >> 高級語言程序設(shè)計(一) >> 文章內(nèi)容

      排行熱點

      2016年4月自考高級語言程序設(shè)計(一)真題_第2頁

      來源:華課網(wǎng)校  [2019年10月20日]  【

        二、填空題(本大題共10小題,每小題2分,共20分)

        11.設(shè)int x=100;,表達式x%2=(x+1)%2的值是_______。

        12.設(shè)int a=2, b-3; 表達式a<< p>

        13.設(shè)char s[10]= "peace";,執(zhí)行語句printf("%d\n", strlen(s));后輸出結(jié)果是_______。

        14.設(shè)float a;,執(zhí)行表達式(double)a后,a的類型是_______。

        15.設(shè)int x=10, y=20;,執(zhí)行語句printf("%d\n", x>y?x:y);后輸出結(jié)果是_______。

        16.設(shè)struct{ float x, y; }z, *p=&z;,用指針引用成員x的方式是(*p).x或_______。

        17.設(shè)int x=3, y=2, z=1;,表達式!x>-y>=z的值是_______。

        18.系統(tǒng)函數(shù)double fabs(double x)的功能是_______。

        19.若函數(shù)的形式參數(shù)和實際參數(shù)均為數(shù)組類型,則函數(shù)調(diào)用時參數(shù)的傳遞方式是_______。

        110.使用系統(tǒng)函數(shù)sin()時,用到的文件包含命令縣_______。

        三、程序分析題(本大題共4小題,每小題4分,共16分)

        21.#include void main(){ int i; char *country[ ]={"Brazil", "Russia", "India", "China", "SouthAfrica"}; for(i=1; i<4; i+=2) printf("%s\n", country [i]);}

        22.#include void main(){ int a=10, b=0; while(1) { a+=2; b+=a; if(b>20) break; }; printf("a=%d, b=%d\n", a, b);}

        23.#include < stdio.h>int z=2;int fun(int x){ static int y=0; return(--y+x+z);}void main(){ int i; for(i=1; i<3; i++) printf("%d#",fun(5); printf("\n");}

        24.#include void main(){ int i; char *st="CHINA"; for(i=0; i<5; i+=2) printf ("%c", *(str+i)); printf("\n");}

        四、程序填充題(本大題共3小題,每小題6分,共18分)

        31.從鍵盤輸入某個職工的工號、姓名和工資保存至結(jié)構(gòu)型變量并輸出。#include typedef struct employee{ int number; char name[20]; float salary;}_______; /*第一空*/void main(){ EMP em; scanf("%d%s%f", &em.number, _______, &em.salary); /*第二空*/ printf("Number: %d\nName: %s\nSalary: %.1f\n", _______); /*第三空*/}

        32.鍵入一串字符,以回車換行符為結(jié)束標志,統(tǒng)計并輸出其中大寫英文字母的個數(shù)。#include void main(){ char a; int s=_______; /*第一空*/ while((c=getchar()!='\n') if(_______) s++; / *第二空*/ printf("大寫英文字母個數(shù)s=%d\n",_______); /*第三空*/}

        33.從鍵盤為二維數(shù)組輸入數(shù)據(jù),分別計算并輸出兩條對角線元素值之和。#include #define N 4void main(){ int [N][N], i, j, sum1=0, sum2=0; for(i=0; i < sum2="sum2+a[i][N-1-i];" printf(?sum1="%d" sum1="sum1+_______;">

        五、程序設(shè)計題(本大題共2小題,每小題8分,共16分)

        41.從文本文件old.txt讀取字符,將其中的英文字母'a'、'b'、'c'、'd'和'e'分別替換為'+'、'-'、'*'、'/'和'%',其余字符不變,然后寫入文本文件 new.txt。

        42.(1)編寫函數(shù)負fa,計算并輸出直角三角形的面積;(2)編寫函數(shù)fb,計算并輸出梯形的面積;(3)編寫主函數(shù),鍵入直角三角形的底(d)和高(h),調(diào)用函數(shù)fa計算并輸出該直角三角形的面積;鍵入梯形的上底(a)、下底(b)和高(c),調(diào)用函數(shù)fb計算并輸出該梯形的面積。(輸出結(jié)果保留兩位小數(shù))

      首頁 1 2 尾頁
      責編:zj10160201