计算机类

Write a script. in PHP and Javascript. to accept two textarea's, slot and alternative by the name.+ slot can contain many a lines, each line includes many words and is ended by a number+ the chars in the slot can only be either alpha-numeric chars or squa

题目

Write a script. in PHP and Javascript. to accept two textarea's, slot and alternative by the name.

+ slot can contain many a lines, each line includes many words and is ended by a number

+ the chars in the slot can only be either alpha-numeric chars or squares or underlines

+ if a word in the slot is surrounded by underlines, it must start a new line in the alternatives,

followed by the detailed definition of the word

+ the square brackets should come in pairs

for example, the following is legal slot and alternative:

SLOT ALTERNATIVE

---------------------- --------------------------

| this is 1 | | _this_ th ee s |

| the is 1 | | |

| this's 2 | | |

| _this_ 2 | | |

---------------------- --------------------------

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

如何使用 PHP 输出 "hello world"()

A."HelloWorld";

B.echo"HelloWorld";

C.Document.Write("HelloWorld");

D.write(“HelloWorld”);


参考答案:B

第2题:

PHP的$_POST可以用来取得以下哪些表单数据?()

A.text

B.password

C.radio

D.textarea


参考答案:A, B, C, D

第3题:

下面的PHP代码输出什么?( )?php$s = ‘12345’;$s[$s[1]] = ‘2’;echo $s;?

A.12345

B.12245

C.22345

D.11345


参考答案:D

第4题:

About ________ of the workers in the factory were born in the ________.

A.two-thirds, 1970 B.two-thirds, 1970s C.two-third,1970 D.two-third, 1970s


正确答案:B

第5题:

有以下程序: main() { char *S[]={"one","two","three"},*p; p=s[1]; printf("%c,%s\n", *(p+1), s[0]); } 执行后输出结果是( )。

A.n,two

B.t,one

C.w,one

D.o,two


正确答案:C
解析:本题首先定义了一个有3个元素的指针数组s,并通过初始化列表使s[0]指向字符串“one”,s[1]指向字符串“two”,s[2]指向字符串“three”,然后通过赋值语句p=s[1],使p指向了字符串“two”,故*(p+1)就是字符‘w’。所以,C选项为所选。

第6题:

有以下程序: matin() { char * s[]={"one", "two", "three"}, *p; p=s[1]; printf("% c, % s\n", *(p+1),s [o]); } 执行后的输出结果是______。

A.n, two

B.t, one

C.w, one

D.o, two


正确答案:C
解析:程序定义了一个指针数组s和一个字符型指针变量p。s有3个元素,其中s[0]指向字符串"one,s[1]指向字符串"two",s[2]指向字符串"three",执行p=s[1]后p指向字符串"two",所以*(p+1)=w。

第7题:

. 分别用 PHP 和Javascript. 来验证两个分别叫 slot 和 alternative 的文本框里面的内容:

+ slot 可以包含许多行,每行又包含若干个单词,并且以数字结尾

+ slot 中的每个单词只能由数字、字母、方括号和下划线构成

+ 如果 slot 中的某个单词前后各有相同书面的下划线,则这个单词必须在 alternatives 另起一

行,并带有其定义

+ 方括号必须成对出现

例如,下面的 slot 和 alternative 是正确的:

SLOT ALTERNATIVE

---------------------- --------------------------

| this is 1 | | _this_ th ee s |

| the is 1 | | |

| this's 2 | | |

| _this_ 2 | | |

---------------------- --------------------------


正确答案:
 

第8题:

有以下程序 main( ) { char *s[ ]={"one","two","three"},*p; p=s[1]; printf("%c,%s\n",*(p+1),s[0]); } 执行后输出结果是

A.n,two

B.t,one

C.w,one

D.o,two


正确答案:C
解析:p首先指向s中的第二个字符串(p=s[1])的起始位置,其中输出语句printf的功能是输出p所指向的后一个字符,及数组元素s[0]。

第9题:

有以下程序

main()

{char *s[]={"one","two","three"},*p;

p=s[1];

printf("%c,%s\n",*(p+1),s[0]);

}

执行后输出结果是

A.n,two

B.t,one

C.w,one

D.O,two


正确答案:C
解析:本题首先定义了一个有3个元素的指针数组s,并通过赋值使s[0]指向字符串“one”,s[1]指向字符串“two”,s[2]指向字符串“three”,然后通过赋值语句“p=s[1]”,使p指向了字符串“two”,故“*(p+1)”就是字符“w”。

第10题:

12. About_______ of the workers in the factory were born in the __________.

A. two- thirds;1970

B. two- thirds ; 1970s

C. two-third ; 1970

D. two-third ; 1970s


正确答案:B
12.B【解析】句意:工厂里大约2/3的工人出生在20世纪70年代。分数的表达为分子用基数词,分母用序数词,如果分子大于1,则分母要用复数,排除C、D,年代的表达要在年份后加s.故选B。