以下哪种初始化数组的方式是错误的?()
第1题:
以下电子邮箱地址的格式中,正确的是( )。
A.wang.163.com
B.wang@163.com
C.wang#163.com
D.www.wang.163.com
第2题:
定义结构体数组:
struct stu
{ int num;
char name[20];
}x[5]={1,"LI",2,"ZHAO",3,"WANG",4,"ZHANG",5,"LIU"};
for(i=1;i<5;i++)
printf("%d%c",x[i].num,x[i].name[2];
以上程序段的输出结果为( )。
A.2A3N4A5U
B.112A3H41
C.1A2N3A4U
D.2H3A4H51
第3题:
D
Anne and Joseph are talking about an interesting question. Why do some people change their names? There can be many reasons. Hanna changed her name to Anne because she thought it would be easier for people to remember. On the other hand, Joseph is thinking about changing his name to an unusual name because he wants to be different.
People have a lot of reasons for changing their names. Film stars, singers, sportsmen and some other famous people often change their names because they want names that are not ordinary, or that have special sound. They chose the “new name” for themselves instead of the name their parents gave them when they were born.
Some people have another reason for changing their names. They have moved to a new country and want to use a name that is usual there. For example, Li Kaiming changed his name to Ken Lee when he moved to the United States. He uses the name Ken at his job and at school. But with his family and Chinese friends, he uses Li Kaiming. For some people, using different names makes life easier in their new country.
In many countries, a woman changes her family name to her husband’s after she gets married. But today, many women are keeping their own family name and not using their husband’s. Sometimes , women use their own name in some situations (情况)and their husband’s in other situations . And some use both their own name and their husband’s.
根据短文内容,完成下面表格。
different people
reason to change the name
Hanna
It is ____61____ for people to remember.
Joseph
He wants to have a name that’s ____62_____.
famous people
Their name may sound _____63_____.
Li Kaiming
Using different names can make ____64_____ easier.
a woman
After she gets _____65_____, she may change her name.
61._________________________________________________________________________
第4题:
定义结构体数组: struct stu { int num; char name[20]; }x[5]={1,"LI",2,"ZHAO",3"WANG",4,"ZHANG",5"LIU"}; for(i=1;i<5;i++) printf("%d %c", x[i].num, x[i].name[2]); 以上程序段的输出结果为( ).
A.2A3N4A5U
B.1I2a3h4I
C.1A2N3A4U
D.2H3A4H5I
第5题:
importjava.util.*;
publicclassNameList{
privateListnames=newArrayList();
publicsynchronizedvoidadd(Stringname){names.add(name);}
publicsynchronizedvoidprintAll(){
for(inti=0;iSystem.out.print(names.get(i)+);
}
}
publicstaticvoidmain(String[]args){
finalNameListsl=newNameList();
for(inti=0;i<2;i++){
newThread(){
publicvoidruin(){
sl.add(”A”);
sl.add(”B”);
sl.add(”C”);
sl.printAll();
}
}.start();
}
}
}
Whichtwostatementsaretrueifthisclassiscompiledandrun?()
第6题:
定义结构体数组:
struct stu
{int num;
charname[20];
}x[5]={1,"LI",2,"ZHAO",3,"WANG",4,"ZHANG",5,"LIU"};
for(i=1;i<5;i++)
printf("%d%C",x[i].num,x[i]name[2]);
以上程序段的输出结果为( )。
A.2A3N4A5U
B.112A3H41
C.1A2N3A4U
D.2H3A4H51
第7题:
It's very interesting to study names of different countries.Chinese names are different (1) foreign names.Once an English lady came to visit me.When I was introduced to her she said, “ Glad to meet you, Miss Ping.” Then she gave me her name card with three words on it:"Betty J.Black.So I said, “Thank you, Miss Betty.” We looked at each other and laughed heartily.Later I found that the English people (2)their family names last and the given names first, while their middle names are not used very much.I explained to her that the Chinese family name comes first, the given name last, so she(3) never call me Miss Ping.She asked if we Chinese had a middle name.I told her we didn't.but people may often find three words
on a Chinese name card.In this case the family name still come first, and the other words after it(4)a two-word given name.it is quite usual in China.My sister is Li Xiaofang.She has two words in her given name instead (5) just one like mine.(完型填空)
A.Put
B.From
C.Should
D.of
E.are
答案:B A C E D
解析:本段意思:研究不同国家的名称是非常有趣的。中国人的名字不同于外国人的名字。有一次,一位英国女士来看我。当我被介绍给她时,她说:“很高兴认识你,萍小姐。然后她给了我她的名片,上面有三个字:“贝蒂·j·布莱克。”所以我说:“谢谢你,贝蒂小姐。我们面面相觑,开怀大笑。后来我发现英国人把姓放在最后,名放在前面,中间的名字用得不多。我向她解释中国姓在前,名在后,所以她永远不要叫我萍小姐。她问我们中国人有没有中间名。我告诉她我们没有。但是人们经常会在一张中文名片上发现三个字。在这种情况下,姓仍然在前面,在它后面的其他单词是两个单词组成的名字。这在中国很常见。我妹妹是李小芳。她有两个字在她的名字,而不像我一样只有一个。
第8题:
阅读以下说明和java代码,将应填入(n)处的字句写在对应栏内。
[说明]
本程序中预设了若干个用户名和口令。用户输入正确的用户名后,可以查找对应的口令,一旦输入结束标记“end”,程序结束。
[Java代码]
import java. io. *:
public class User {
public String user;
public Siring pass;
public User() { }
public User( String u,String p) {
user=u;
pass=p;
}
public String (1) () { return this. user; }
public String (2) () { return this. pass; }
public static void main(String[] args) {
User ua[]={new User("Li","123456"), new User("wang","654321"),
new User("Song","666666")};
while(true) {
InputStreamReader reader = new InputStreamReader(System. in);
BufferedReader inpul = new BnfferedReader(reader);
System. out. print("Enter your name:");
String name = null;
try { name = input. readLine();}
catch (IOException ex) {}
if((3)) break;
int i;
for (i=0;i<3;i++) {
if (name. equals(ua[i]. getUser())){
System. out. println("密码:"+ua[i].getPass());
(4);
}
}
if ((5)) System. out. println("该用户不存在!");
}
}
}
第9题:
String s="zhang san,li si,wang wu"; 按字母顺序对姓名
第10题:
定义结构体数组: struct stu { int num; char nameE20]; }X[5]={1,"LI",2,"ZHAO",3,"WANG",4," ZHANG",5,"LIU"); for(i=1;i<5;i++) printf("%d%c",x[i].num,x[i].name[2]); 以上程序段的输出结果为( )。
A.2A3N4A5U
B.112A3H4I
C.1A2N3A4U
D.2H3A4H5I