日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

浙江省计算机二级c理论题库,浙江省计算机级考试二级《C程序设计》上机考试题库.doc...

發(fā)布時(shí)間:2023/12/19 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 浙江省计算机二级c理论题库,浙江省计算机级考试二级《C程序设计》上机考试题库.doc... 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

浙江省計(jì)算機(jī)級(jí)考試二級(jí)《C程序設(shè)計(jì)》上機(jī)考試題庫

上機(jī)程序調(diào)試及程序設(shè)計(jì)練習(xí)

一、程序填空

(1) 找Armstrong(水仙花)數(shù):

#include

#include

void main()

{ int i,a,b,c;

for(i=100;i<=999;i++)

{ a=i/100;

_______1_______

c=i%10;

371=3*3*3+7*7*7+1*1*1

// b=i%100/10;

if (________2________)

// a*a*a+b*b*b+c*c*c = = i

printf("%d is a Armstrong number!\n",i);

}

}

(2) 輸入1 個(gè)整數(shù)后,輸出該數(shù)的位數(shù)。(例:輸入3214則輸出 4,輸入-23156則輸出5)。

#include

void main()

{

int n,k=0;

scanf("%d",&n);

while( _____1_____ ){

k++;

_____2_____;

}

printf("%d\n",k);

// n!=0

// n=n/10

}

?_ 3 ?_ lB彄Qev?etepT_OMep[WNKT??fiY倧"Qe

#include

#include

void main()

{

int n,s=0;

scanf("%d",&n);

______ 1 ______

while(n!=0) {

______ 2 ______

n=n/10;

}

printf("%d\n",s);

234 R6彄Qú 9?fi彄Qe -312 R6彄Qú 60_

// if (n<0) n=-n;

// s+=n%10;

1 of 25

4/21/2010

}

?_ 4 ?_ ?_u(Qyep

f?fi\_N_N*etep櫀\>P/n0_O?Y??7傚zff^弿"Qe

12345?fiR6彄Qú

54321?8傚zff^弿"Qe

-34567?fi

R6彄Qú -765430_

#include

#include

long f(long n)

{ long m,y=0; m=fabs(n);

while(m!=0) {

y=y*10+m%10;

____1____

}

if(n>=0) return y;

else _____2_____

}

void main()

{

// m=m/10 ?8

// return -y ;

printf("%ld\t",f(12345)); printf("%ld\n",f(-34567));

}

?_ 5 ?_ ?_u(Qyep

f?fiN?[W{&N2N-R -db@gv?ep[W[W{&0_

#include

#include

#include

void f(char *s)

{ int i=0;

while(s[i]!='\0'){

if(isdigit(s[i])) ____1____(s+i,s+i+1); // strcpy

___2___ i++;}

}

void main()

{ char str[80];

gets(str); f(str); puts(str);

}

// else

?_ 6 ?_ ?_u(

find QyepW(彄Qev?[W{&N2N-g?b~f/T&Qús°"the"徺N*SU嬐0_Y?g?g?R0徳VTQús°v?k!ep?fiY?g?

g*b~R0徳VT00_

#include

int find(char *str)

{ char *fstr="the";

int i=0,j,n=0;

while (str[i]!='\0')

{

for(______1______)

// j=0; j<3; j++

2 of 25

4/21/2010

if (str[j+i]!=fstr[j]) break;

if (______2______) n++;

i++;

}

return n;

}

void main()

{ char a[80];

gets(a);

printf("%d",find(a));

}

// j>=3

?_

總結(jié)

以上是生活随笔為你收集整理的浙江省计算机二级c理论题库,浙江省计算机级考试二级《C程序设计》上机考试题库.doc...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。