网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s;
A.byte, short, int, long, float, double
B.boolean, byte, short, char, int, long, float, double
C.byte, short, char, int, long, float, double
D.byte, short, char
E.int, long, float, double
参考答案
更多 “ 以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s; A.byte, short, int, long, float, doubleB.boolean, byte, short, char, int, long, float, doubleC.byte, short, char, int, long, float, doubleD.byte, short, charE.int, long, float, double ” 相关考题
考题
请编写一个函数unsigned short fun(unsigned short s)。其中s是一个大于10的无符号整数,若s是一个n(n≥2)位整数,函数求出s的n位数之和作为函数的返回值。例如,s值为4315,则函数返回13。s值为13函数,则返回4。注意:部分源程序已存在文件PROC15.cpp中。请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句。文件PROC15.cpp的内容如下://PROC15.cppinclude<iostream>using namespace std;unsigned short fun(unsigned short s);int main(){unsigned short a;cout<<"Enter a unsigned short integer number:";cin>>a;if(a<10)cout<<"Data error!";elsecout<<"The result: "<<fun(a)<<end1;return 0;}unsigned short fun(unsigned short s){//* * * * * *}
考题
(b) Calculate the inheritance tax (IHT) liability arising as a result of Christopher’s death. (11 marks)
考题
Given:11.Stringtest=TestA.TestB.TestC.;12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpression,insertedatline12,correctlysplitstestintoTestA,TestB,andTestC?()A.Stringregex=;B.Stringregex=;C.Stringregex=.*;D.Stringregex=\\s;E.Stringregex=\\.\\s*;
考题
以下程序的功能是:从低位开始取出长整型变量s中奇数位上的数,依次构成一个新数放在t中。高位仍在高位,低位仍在低位。请填空。 include<stdio.h> main() {long s,t,s1=10; pfintf("\n.Please enter s:"); scanf("%1d",s); t=s%10; while(s>0) {s=s/100; t=( ); s1=s1*10; } printf("The result is:%1d\n",t); }
考题
在窗体中使用一个文本框名为n.接受输入的值,有一个命令按钮run,事件代码如下: Private Sub run_Click( ) result = "" For i = 1 To Me!n For j = 1 To Me!n result = result + "*" Next j result = result + Chr(13) + Chr(10) Next i MsgBox result End Sub 打开窗体后,如果通过文本框输入的值为4,单击命令按钮后输出的图型是A. * * * * * * * * * * * * * * * *B. * * * * * * * * * * * * * * * *C. * * * * * * * * * * * * * * * * * * * * * * * * * * * *D. * * * * * * * * * * * * * * * *
考题
在窗体中使用一个文本框名为num1.接受输入值,有一个命令按钮run13,事件代码如下: Private Sub run13_Click If Me!num1 = 60 Then result = "及格" ElseIf Me!num1 = 70 Then result = "通过" ElseIf Me!num1 = 85 Then result = "合格" End If MsgBox result End Sub 打开窗体后,若通过文本框输入的值为85,单击命令按钮,输出结果是 【13】 。
考题
在窗体上有一个名为num2的文本框和run11的命令按钮,事件代码如下: Private Sub run11 Click( ) Select Case num2 Case 0 Result=“0分” Case 60 T0 84 result= “通过” Case IS=85 result= “优秀” Case Else result=“不合格” End Select MsgBox result End Sub 打开窗体,在文本框中输入80,单击命令按钮,输出结果是( )。A.合格B.通过C.优秀D.不合格
考题
What’s the final result?(下面这段代码的最终运行结果是什么)double expectedValue = 1/2;if(expectedValue 0){expectedValue = expectedValue + 0.5;}Console.WriteLine(expectedValue);
考题
以下n变量赋值必须进行强制类型转换的是( )。A.int n;n=100+10;B.int n;n=100F+10;C.int n;short m=10;n=100+m;D.int n;short m=10;char s=2;n=s+m;
考题
struct w{ char low;char high;};union u{ struct w byte;short word;}uw;main( ){ int result;uw.word=0x1234;printf(“word value:%04x\n”,uw.word);printf(“high byte:%02x\n”,uw.byte.high);printf(“low byte:%02x\n”,uw.byte.low);uw.byte.low=0x74;printf(“word value:%04x\n”,uw.word);result=uw.word+0x2a34;printf(“the result:%04x\n”,result);}
考题
以下代码的输出结果是() while(1) { $var++; $result=$var; if($result==17)break; $var--; } echo($result);A、0B、17C、18D、这是一个无限循环,没有输出
考题
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A、 An exception is thrown at runtime.B、 1C、 4D、 Compilation fails.E、 0
考题
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()A、a b cB、1 2 3C、a1b2c3D、a1 b2 c3
考题
关于数据类型转换下面描述错误的是()A、byte类型数据可以转换为short、int、long类型数据B、long类型数据有可能转换为byte、short、int类型数据C、在语句int i=(int)78.67;中,变量i的值为79D、当两个数据的类型不同一时,必须先进行数据类型的转换,再运算或赋值
考题
11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A、 String regex = “”;B、 String regex = “ “;C、 String regex = “.*“.D、 String regex = “//s”E、 String regex = “//.//s*”;F、 String regex = “//w[ /.] +“;
考题
Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()A、The value of s is 14-dic-2000.B、The value of s is Dec 14, 2000.C、An exception is thrown at runtime.D、Compilation fails because of an error in line 13.
考题
单选题Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()A
String regex = ;B
String regex = ;C
String regex = .*;D
String regex = //s;E
String regex = //.//s*;
考题
单选题Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()A
The value of s is 14-dic-2000.B
The value of s is Dec 14, 2000.C
An exception is thrown at runtime.D
Compilation fails because of an error in line 13.
考题
单选题Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()A
a b cB
1 2 3C
a1b2c3D
a1 b2 c3
考题
单选题12. Date date = new Date(); 13. df.setLocale(Locale.ITALY); 14. String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()A
The value of s is 14-dic-2004.B
The value of s is Dec 14, 2000.C
An exception is thrown at runtime.D
Compilation fails because of an error in line 13.
考题
单选题Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("/s"); 13.System.out.println(tokens.length); What is the result?()A
0B
1C
4D
Compilation fails.
热门标签
最新试卷