I am interested in the training course, which ______ at Hilton Hotel in Beijing from March 8 to 12, 2021.
A.held
B.was held
C.will hold
D.will be held
A.held
B.was held
C.will hold
D.will be held
考虑如下类:
1. class Test(int i) {
2. void test(int i) {
3. System.out.println("I am an int.");
4. }
5. void test(String s) {
6. System.out.println("I am a string.");
7. }
8.
9. public static void main(String args[]) {
10. Test t=new Test();
11. char ch="y";
12. t.test(ch);
13. }
14. }
以下哪条为真?
A.行 5 不能通过编译,方法不能被覆盖.
B.行 12 不能通过编译, 因为没有一个test()方法含字符参数.
C.代码可以编译但在12行将出现异常.
D.代码可以编译且产生如下输出: I am an int.
E.代码可以编译且产生如下输出: I am a String.
阅读以下说明和C代码,将应填入(n)处的字句写在对应栏内。
【说明】
该程序的功能是从文件IN.DAT中读取一篇英文文章存入到字符串数组xx中,以行为单位对行中以空格或标点符号为分隔的所有单词进行倒排。最后把已处理的字符串(应不含标点符号)仍按行重新存入字符串数组xx中,最后把结果xx输出到文件OUT6.DAT中。
例如:原文:You He Me
I am a student.
结果:Me He You
student a am I
原始数据文件存放的格式是:每行的宽度均小于80个字符,含标点符号和空格。
【函数】
include<string.h>
include<conio.h>
include<ctype.h>
include<stdio.h>
char xx[50] [80];
int maxline=0; /*文章的总行数*/
int ReaaDat(void);
void WriteDat(void);
void StrOL(void)
{
char * p1, * p2,t[80];
int i;
for(i=0;i<maxline;i++)
{ p1=xx[i];t[0]=0;
while(*p1)p1++;
while(p1>=xx[i])
{ while(!isalpha(*p1) &&p1!=xx[i])p1--;
p2=p1;
while((1))p1--;
if(p1==xx[i])
if(isalpha(*p1))p1--;
else if(!isalpha(*(p1+1)))break;
p2++;
(2);
strcat(t, p1+1);
strcat(t," ");
}
strcpy(xx[i],t);
}
}
void main()
{
if((3)) {
printf("数据文件in.dat不能打开!\n\007" );
return;
}
StroL();
writeDat();
getch();
} int ReadDat(void)
{
FILE * fp;
int i =0;
char * p;
if((fp=fopen("e:\a\in.dat"," r" ))==NULL)return 1;
while(fgets(xx[i],80,fp)!=NULL) {
p=strchr(xx[i],'\n')
if(p)*p=0;
i++;
}
maxline=(4)
fclose(fp);
return 0;
}
void WriteDat(void)
{
FILE * fp;
int i;
fp=fopen("e:\\a\\out6,dat","w");
for(i=0;i<(5);i++){
printf("%s\n",xx[i]);
fprintf(fp,"%s\n",xx[i])
}
fclose(fp)
}
●试题四
阅读以下说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
该程序的功能是从文件IN.DAT中读取一篇英文文章存入到字符串数组xx中,以行为单位对行中以空格或标点符号为分隔的所有单词进行倒排。最后把已处理的字符串(应不含标点符号)仍按行重新存入字符串数组xx中,最后把结果xx输出到文件OUT6.DAT中。
例如:原文:You He Me
I am a student.
结果:Me He You
student a am I
原始数据文件存放的格式是:每行的宽度均小于80个字符,含标点符号和空格。
【函数】
#include<string.h>
#include<conio.h>
#include<ctype.h>
#include<stdio.h>
char xx[50][80];
int maxline=0;/*文章的总行数*/
int ReaaDat(void);
void WriteDat(void);
void StrOL(void)
{
char*pl,*p2,t[80];
int i;
for(i=0;i<maxline;i++)
{p1=xx[i];t[0]=0;
while(*p1)p1++;
while(p1>=xx[i])
{while(!isalpha(*p1)&&p1!=xx[i])p1--;
p2=p1;
while((1) )p1--;
if(p1==xx[i])
if(isalpha(*p1))p1--;
else if(!isalpha(*(p1+1)))break;
p2++;
(2) ;
strcat(t,p1+1);
strcat(t," ");
}
strcpy(xx[i],t);
}
}
void main()
{
if((3) ){
printf("数据文件in.dat不能打开!\n\007");
return;
}
StrOL();
writeDat();
getch();
}
int ReadDat(void)
{
FILE*fp;
int i=0;
char*p;
if((fp=fopen("e:\\a\\in.dat","r"))==NULL)return 1;
while(fgets(xx[i],80,fp)!=NULL){
p=strchr(xx[i],′\n′);
if(p)*p=0;
i++;
}
maxline= (4)
fclose(fp);
return 0;
}
void WriteDat(void)
{
FILE*fp;
int i;
fp=fopen("e:\\a\\out6.dat","w");
for(i=0;i< (5) ;i++){
printf("%s\n",xx[i]);
fprintf(fp,"%s\n",xx[i]);
}
fclose(fp);
}
请分析下列程序。 int main() { printf("This is in main program"); if(fork()==0) printf("I am in child process"); else printf("I am in parent process");} 程序正确运行后结果是
A.This is in main program I am in child process I am in parent process
B.This is in main program I am in child process
C.This is in main program I am in parent process
D.This is in main program I am in child process This is in main program I am in parent process
A、I’d like to buy something by Nike
B、It’s very beautiful
C、That’s three hundred yuan
D、Yes, but not frequently
A.It’s OK. How about you?
B.Going well.
C.Not ba
D.I am fine, thank you.
已知p为指针变量,a为数组名,i为整型变量,下列语句中,不正确的是______。
A.p=&i;
B.p=a;
C.p=&a[i];
D.p=10;
请补充函数proc(),该函数的功能是:把从主函数中输入的字符串str2接在字符串str1的后面。
例如,str1=”I am a”,str2=”student”,结果输出:I am a student。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
A.我很高兴看到“全球2000-国际商业信贷银行”组织在公共卫生领域正在从事两项工作。
B.我很高兴看到“全球2000-国际商业信贷银行”组织在公共卫生领域正在发起两项工程。
C.我很高兴看到“全球2000-国际商业信贷银行”组织在公共卫生领域正在进行两个计划。