【说明】 【C程序1】用回溯算法来产生由0或1组成的2m个二进位串,使该串满足以下

题型:问答题

问题:

【说明】
【C程序1】用回溯算法来产生由0或1组成的2m个二进位串,使该串满足以下要求。
视串为首尾相连的环,则由m位二进制数字组成的2m个子序列,每个可能的子序列都互不相同。例如,如果m=3,在串11101000首尾相连构成的环中,由3位二进制数字组成的每个可能的子序列都在环中恰好出现一次,它们依次是111,110,101,010,100,000,001,011,如图2-14所示。


【C程序2】是求“背包问题”的一组解的递归算法程序。“背包问题”的基本描述是:有一个背包,能盛放的物品总重量为S,设有N件物品,其重量分别为W1,W2,…,Wn,希望从N件物品中选择若干件物品,所选物品的重量之和恰能放入该背包,即所选物品的重量之和等于S。
【C程序1】
#define N 1024
#define M 10
int b [N+M-1]
int equal(int k, int j int m)
int i;
for(i=0; i<m; i++
if ( b[ k + i] (1) )
return 0;
return 1;
int exchange (int k, int m, int v)
while ( b[ k + m - 1 ) == v )
b[ kncm--i]=! v (2) ;

(3) =v;
return k;init ( iht v)
int k
for( k = 0;K = N + M - 1;k++)
b[k] = v;main ( )
int m, v, k, n, j;
printf (’Enter m (l<m<10) , v v=0, v=1)\ n") ;
scanf (" %d%d , &m, &v);
n = 0x01 << m;
init (!v);
k=0;
while( (4) < n)
for (j=0;j<k;j++)
if (equal (k, j, m))
k=exchange (k, m, v)
j= (5) ;

for (k= 0 ;k<n ;k++ )
print (" %d\ n" , b[k]) ;
【C程序2】
#include<stdio. h>
#define N 7
#define S 15
int w[N+1] = 0, 1, 4, 3, 4, 5, 2, 7;
int knap (int S, int n)
if (S == 0)
return 1;
if (s<0 || (s>0 && n<1))
return 0;
if ( (6) ))
printf( "4d", w[n]);
return 1;

return (7) main ( )
if (knap (S, N)
printf("OK:\n");
else
printf("NO!\n")

考点:计算机软件水平考试初级程序员初级程序员下午试题
题型:问答题

某糖尿病患者其一份早餐如下:一杯牛奶200mL、一根油条30g、一个花卷50g。试从血糖生成指数和血糖负荷角度对其早餐进行评价。
每种食物的相关数据如下表:

  GI值 碳水化合物含量(g) 膳食纤维含量(g)
牛奶 27.6 3.4  
油条 74.9 51.0 0.9
花卷 88.1 45.6 1.5

题型:问答题

“义务教育”中的“义务”是指 [ ]

A.学校必须遵循并应尽的义务

B.家庭必须遵循并应尽的义务

C.国家、社会、学校、家庭和适龄儿童少年必须遵循并应尽的义务

D.学校、家庭和适龄儿童少年必须遵循并应尽的义务

题型:问答题

大多数可经非手术治疗好转的是

A.瘢痕性幽门梗阻
B.胃十二指肠溃疡大出血
C.胃十二指肠溃疡急性穿孔
D.十二指肠溃疡并球部变形

题型:问答题

完成句子

       阅读下列各小题, 根据所给的整句汉语提示, 用句末括号的英语单词完成句子, 并将答案写在相应题号后。

1. Every year one million tourists visit Stonehenge, which is believed_      _ __   _ _         _      _before the Pyramids,

about 4000 years ago. (construct)

每年大约有一百万游客参观巨石阵, 据说它是在四千年以前被修建, 早于埃及的金字塔。

2. I am afraid you had better not call me at 3 o'clock on the afternoon of tomorrow. I_       _ _         

_       _ _             _       _then.

(have)

你最好不要在明天下午三点钟给我打电话。那时我在开会。

3. Greatly loved in Chinese adolescence____ ____Korean TV plays. (romantic)

浪漫的韩剧极受中国青少年欢迎。

4. The iphone functions well.  I'll buy it, _      _ _      _ _      _ _        _. (cost)

这款iphone 功能不错, 无论多贵, 我都要买。

5. _         __    _ _       _ _       _, many animals are facing the danger of dying out. (destroy)

大部分森林毁掉了, 很多动物面临着灭绝的危险。

6.  _      _ __      _      _ _      _to the conference surprised us, since he was an important figure in this

field after all. (invite)

他没有被邀请参加会议很让我们吃惊, 毕竟他是这一行业的重要人物。

7. But for your timely encouragement , I_       _ _      _ _      _ _       _after going through so much

difficulty. (lose)

要不是你的及时鼓励, 经历这么多的困难之后我早就灰心了。

8. He is going to spend the Spring Festival in his home village, ____ ____his parents and some relatives.

(live)

他打算到他的家乡过春节, 他的父母和亲戚还生活在那里。

9. The king of Prussia_      _ _      _ _      _ __      that his greatest gift to the Russian people would have

such an amazing

history. (imagine)

普鲁士的国王决不可能想到他送给俄罗斯人民的这件伟大礼物会经历这么一段惊奇的历史。

10. When the survivor came to life, he was eager to know_       _ _         __        ___       saved him from

the burning house.

(be)

当生还者醒过来后, 他急切的想知道是谁把他从燃烧的房子里救出来的。

题型:问答题

德州有二级邮区中心局。

更多题库