问题 选择题

下列句子中没有语病的一句是[ ]

A.刘量程的《一个人的村庄》、梭罗的《瓦尔登湖 》等中外散文佳作,都具有积极的思想倾向,因而文笔清新自然,又充满思辨色彩,耐人咀嚼。

B.为北京申奥成功做出贡献的《申办报告》是一幅全面展现中国北京风采的锦绣画卷,已被国际奥委会收藏,目前陈列在洛桑奥林匹克博物馆中。

C.如果中国不能缓解人口增长对水土资源造成的巨大负担,那么环境的恶化将会危及社会经济的可持续发展。

D.记者日前通过调查发现,中国人不爱喝牛奶的原因主要是人们的饮食习惯还没有随着生活水平的提高而相应改善所致。

答案

答案:B

问答题

【说明】
本程序的功能是实现任意两个大整数的乘法运算,例如:
输入整数1:8934793850094505800243958034985058
输入整数2:234584950989689084095803583095820923
二者之积:
209596817742739508050978890737675662366433464256830959194834854876 8534
【C++代码】
#include<iostream.h>
const int MAXINPUTBIT=100;
const int MAXRESULTBIT=500;
class LargeNumber
int i,j;
int temp;
int one[MAXINPUTBIT+1];
int onebit; //one的位数
int two[MAXINPUTBIT+1];
int twobit; //two的位数
int result[MAXRESULTBIT+1];
public:
LargeNumber();
~LargeNumber();
int inputone(); //出错返叫0,否则返回1
int inputtwo(); //同上
void multiplication(); //乘
void clearresult(); //清零
void showresult();//显示
;
LargeNumber∷LargeNumber()

for(i=0;i<=MAXINPUTBIT;i++)

one[i]=0;
two[i]=0;

onebit=0;
twobit=0;
inputone();
inputtwo();

LargeNumber∷~LargeNumber()


int LargeNumber∷inputone()

char Number[MAXINPUTBIT+1];
cout<<"Please enter one:";
cin>>Number;
i=0;
j=MAXINPUTBIT;
while(Number[i]!=’\0’)
i++;
onebit=i;
for(i--;i>=0;i--,j--)

if(int(Number[i])>=48&&int(Number[i])<=57)
(1) ; //由字符转换为数字
else
return 0;

return 1;

int LargeNumber∷inputtwo()

char Number[MAXINPUTBIT+1];
cout<<"Please enter two:";
cin>>Number;
i=0;
j=MAXINPUTBIT;
while(Number[i]!=’\0’)
i++;
twobit=i;
for(i--;i>=0;i--,j--)

if(int(Number[i])>=48&&int(Number[i])<=57)
two[j]=int(Number[i]-48); //由字符转换为数字
else
return 0;

return 1;

void LargeNumber∷multiplication() //乘法

clearresult();
int m;
for(i=MAXINPUTBIT;i>=0;i--)

temp=two[i];
for(j= (2) ,m=MAXINPUTBIT;m>=0;m--,j--)

result[j]+=temp*one[m];
if(result[j]>9)

result[j-1]+=result[j]/10;
(3) ;



cout<<"one*two=";
showresult();

void LargeNumber∷showresult()

i=0;
while(result[i]==0&&i<=MAXRESULTBIT)
i++;
if(i>MAXRESULTBIT)
cout<<"0"; //输出0
for(;i<=MAXRESULTBIT;i++)
cout<< (4) ;
cout<<endl;

void LargeNumber∷clearresult()

for(i=0;i<=MAXRESULTBIT;i++)
(5) ;

void main()

LargeNumber a;
a.multiplication();

单项选择题 A1型题