- 相關推薦
計算機二級C語言真題填空題
(1) 軟件需求規格說明書應具有完整性、無歧義性、正確性、可驗證性、可修改性等特性,其中最重要的_[1]_______.
(2) 在兩種基本測試方法中, _[2]_______測試的原則之一是保證所測模塊中每一個獨立路徑至少要執行一次.
(3) 線性表的存儲結構主要分為順序存儲結構和鏈式存儲結構.隊列是一種特殊的線性表,循環隊列是隊列的_[3]_______存儲結構.
(4) 對下列二叉樹進行中序遍歷的結果為_[4]_______
F
/ \
C E
/ \ \
A D G
/ / \
B H P
(5) 在E-R圖中距形表示_[5]_______
(6) 執行以下程序時輸入1234567,則輸出結果是_[6]_______.
#include
main()
{ int a=1,b;
scanf("%2d%2d",&a&b);printf("%d %d\n",a,b);}
(7) 以下程序的功能是:輸出a、b、c三個變量中的最小值.請填空。
#include
main()
{ int a,b,c,t1,t2;
scanf("%d%d%d",&a,&b,&c);
t1=a
t2=c
printf("%d\n",t2);}
(8) 以下程序的輸出結果是_[9]_______.
#include
main()
{ int n=12345,d;
while(n!=0){ d=n%10; printf("%d",d); n/=10;}}
(9) 有以下程序段,且變量已正確定義和賦值
for(s=1.0,k=1;k<=n;k++) s=s+1.0/(k*(k+1));
printf("s=%f\n\n",s);
請填空,使下面程序段的功能為完全相同
s=1.0;k=1;
while(_[10]_______){ s=s+1.0/(k*(k+1)); _[11]_______;}
printf("s=%f\n\n",s);
(10) 以下程序的輸出結果是_[12]_______.
#include
main()
{ int i;
for(i='a';i<'f';i++,i++) printf("%c",i-'a'+'A');
printf("\n");}
(11) 以下程序的輸出結果是_[13]_______.
#include
#include
char *fun(char *t)
{ char *p=t;
return(p+strlen(t)/2);}
main()
{ char *str="abcdefgh";
str=fun(str);
puts(str);}
(12)以下程序中函數f的功能是在數組x的n個數(假定n個數互不相同)中找出最大最小數,將其中最小的數與第一個數對換,把最大的數與最后一個數對換.請填空.
#include
viod f(int x[],int n)
{ int p0,p1,i,j,t,m;
i=j=x[0]; p0=p1=0;
for(m=0;m
{ if(x[m]>i) {i=x[m]; p0=m;}
else if(x[m]}
t=x[p0]; x[p0]=x[n-1]; x[n-1]=t;
t=x[p1];x[p1]= _[14]_______; _[15]_______=t;}
main()
{ int a[10],u;
for(u=0;u<10;u++) scanf("%d",&a);
f(a,10);
for(u=0;u<10;u++) printf("%d",a);
printf("\n");}
(13)以下程序統計從終端輸入的字符中大寫字母的個數,num[0]中統計字母A的個數,num[1]中統計字母B的個數,其它依次類推.用#號結束輸入,請填空.
#include
#include
main()
{ int num[26]={0},i; char c;
while((_[16]_______)!='#')
if(isupper(c)) num[c-‘A’]+= _[17]_______;
for(i=0;i<26;i++)
Printf("%c:%d\n",i+'A',num);}
(14)執行以下程序的輸出結果是_[18]_______.
#include
main()
{ int i,n[4]={1};
for(i=1;i<=3;i++)
{ n=n[i-1]*2+1; printf("%d",n); }}
(15) 以下程序的輸出結果是_[19]_______.
#include
#define M 5
#define N M+M
main()
{ int k;
k=N*N*5; printf("%d\n",k);}
(16)函數main()的功能是:在帶頭結點的單鏈表中查找數據域中值最小的結點.請填空
#include
struct node
{ int data;
struct node *next;};
int min(struct node *first)/*指針first為鏈表頭指針*/
{ strct node *p; int m;
p=first->next; m=p->data;p=p->next;
for(;p!=NULL;p=_[20]_______)
if(p->datadata;
return m;}
【計算機二級C語言真題填空題】相關文章:
計算機二級C語言真題04-16
計算機二級C語言上機程序填空題04-04
計算機等級考試二級C語言填空題05-21
計算機二級C語言筆試真題05-10
計算機二級《C語言》真題練習04-30
計算機二級C語言真題選擇題07-20
計算機二級C語言填空題專項訓練及答案12-22
計算機二級C語言歷年真題及答案03-24