问题 选择题

Jack said that he was sure of succeeding in passing the Totel Examination this time, _______, in my opinion, I don’t think so.

A.what

B.which

C.but

D.therefore

答案

答案:C

考查并列句。此题易误认为是非限制性定语从句而选B。根据从句中主语和宾语都完整,可以看出是并列句。

问答题

以下是某C++程序,用来判定用户口令,请仔细阅读程序并完成要求。

//**********************************************************//

// 口令检验程序 //

// //

// 文件名:password_check.cpp //

//**********************************************************//

#include

#include

//**********************************************************//

// 主 函 数 //

//**********************************************************//

void main(void)

{

char password[128]={’\0’);

cout<<"请输入您的口令:";

cout.flush();

while(true){

cin.getline(password, 128,’\n’);

if(strlen(password)<6) //口令长度少于6位

{

cout<<"您的用户口令少于6个字符!"<endl;

cout<<"请重新输入:";

cout.flush();

}else{

bool capital=false; //检验是否有大写字母

bool lowercase=false; //检验是否有小写字母

bool digit=false; //检验是否有数字

for(unsigned int i=0;i<strlen(password);i++){

if(password[i]>=’A’&&password[i]<=’Z’)

capital=true;

if(password[i]>=’a’&&password[i]<=’z’)

lowercase=true;

if(password[i]>=’0’&&password[i]<=’9’)

digit=true;

}

//判断用户输入的口令中缺少哪中字符

if(!capital){

cout<<"您的用户口令中没有大写字母!"<<endl;

cout<<"请重新输入:";

}else if(!lowercase){

cout<<"您的用户口令中没有小写字母!"<<endl;

cout<<"请重新输入:";

}else if(!digit){

cout<<"您的用户口令中没有数字!"<<endl;

cout<<"请重新输入:";

)else{

cout<<"您的口令满足要求!"<<endl;

break;

}

}

}

}

画出此程序主函数的控制流程图。

问答题