网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

18、如果依次输入4, 6.8, 1, 9.7, -2,请问以下程序的输出结果是____________。number = eval(input()) max = number while number>0: number = eval(input()) if number > max: max = number print(max)


参考答案和解析
D 这是一组奇偶项数列,奇数项为1,2,4,8,(),是一组公比为2的等比数列。偶数项为2,4,6,8,是一组公差为2的等差数列,所以D项为正确答案。
更多 “18、如果依次输入4, 6.8, 1, 9.7, -2,请问以下程序的输出结果是____________。number = eval(input()) max = number while number>0: number = eval(input()) if number > max: max = number print(max)” 相关考题
考题 在窗体上画一个命令按钮,然后写出如下事件过程:Private Sub Command1_Click()s=1Dos=(s + 1) ^ (s + 2)Number=Number + 1Loop Until s =6Print Number, sEnd Sub程序运行后,输出的结果是( )。A.23B.318C.18D.1020

考题 已知、max_number_of_sdcch=24、number_sdcch_preferred=16、sdcch_need_high_water_mark=4、sdcch_need_low_water_mark=16,当sdcch被占用几个时TCH会向sdcch转换()。A.24B.21C.12D.13

考题 请补充完整程序,使得程序能实现以下功能:从文件IN.dat中读取200个整数至数组number中,求出最大数max及最大数的个数cnt和数组number中能被3整除或能被7整除的算术平均值ave(保留2位小数)。把结果max、 cnt、ave输出到OUT. dat文件中。注意:部分程序、读数据函数read_ dat (int number[200])及输出格式已给出。include <conio. h>include <stdio. h>define N 200void read_ dat(int number[N]){ int i, j;FILE *fp;fp = fopen("IN. dat", "r");for (i=0; i<20; i++){ for (j=0; j<10; j++){ fscanf(fp, "%d,", number[i*10+j]);printf("%d ", number[i*10+j]);}printf ("\n");}fclose (fp);}void main (){ int cnt, number[N], max;float ave;FILE *fw;int i, k; 'long j = 0;fw = fopen("OUT.dat", "w");read_ dat (number);/ ************************************************ // ************************************************ /printf("\n\nmax=%d, cnt=%d, ave=%6.2f\n", max, cnt, ave);fprintf(fw, "%d\n%d\n%6.2f\n", max, cnt, ave);fclose (fw);}

考题 下列程序的输出结果是【 】。 includeclass MyClass{public: int number; void set(in 下列程序的输出结果是【 】。include<iostream. h>class MyClass{public:int number;void set(int i);};int number=3;void MyClass: :set (int i){number=i;}void main( ){MyClass my1;int number=10;my1.set(5),cout<<my1, number<<',';my1.set(number);cout<<my1.number<<',';my1.set(: :number);cout<<my1.number<<'.';}

考题 Examine the description of the EMPLOYEES table:EMP_ID NUMBER(4) NOT NULLLAST_NAME VARCHAR2(30) NOT NULLFIRST_NAME VARCHAR2(30)DEPT_ID NUMBER(2)JOB_CAT VARCHARD2(30)SALARY NUMBER(8,2)Which statement shows the maximum salary paid in each job category of each department? ()A. SELECT dept_id, job_cat, MAX(salary) FROM employees WHERE salary MAX (salary);B. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id,job_cat;C. SELECT dept_id, job_cat, MAX(salary) FROM employees;D. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id;E. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept _ id job _ cat salary;

考题 已知C源程序如下: include include void reverse(char S[]){ int C,i,J; f 已知C源程序如下:include<stdio. h>include<string. h>void reverse(char S[]){int C,i,J;for(i=0,j=strlen(s)-1;i<j;i++,j++){c=s[i];s[i]=s[j];s[j]=c;}}void getHex(int number,char s[]){int I;i=0;while(number>0){if(number%16<10)s[i++]=number%16+'0';elseswitch(number%16){case 10:s[i++]='A';break;case 11:s[i++]='B';break;case 12:s[i++]='C';break;case 13:s[i++]='D';break;case 14:s[i++]='E';break;case 15:s[i++]='F';break;default:printf("Error");break;}number/=16;}s[i]:'\o';reverse(s);}int main(){unsigned int number;int i=0:char s[50];printf("%s","please input number;\n");scanf("%d",&number):getHex(number,s);i=0;while(s[i])printf("%c",s[i++]);return 0;}画出程序中所有函数的控制流程图。

考题 有以下程序: main() { char k: int i; for(i=1:i<3;i++) { scanf("%c",k); switch(k) { case'0':printf("another\n"); case'1':printf("number\n"); } } } 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是 ______。A.another numberB.another number anotherC.another number numberD.number number

考题 阅读以下说明和Java代码,将应填入(n)处的语句写在对应栏内。【说明】进行两个整数之间的比较,由考生通过输入窗口分别输入两个整数,程序比较出结果。例如:先后输入的两个数分别为25和36。比较结果显示:25!=3625<3625<=36【Java代码】import javax.swing.JOptionPane;public class Java3{public static void main(String args[]){String (1) // 用户输入第1个字符串secondNumber, // 用户输入第2个字符串result; // 包含输出int number1, // 比较的第1个数number2; // 比较的第2个数// 用户输入的第1个字符串firstNumber =JOptionPane. (2) ("Enter first integer:");//读用户输入的第2个字符串secondNumber =JOptionPane.showlnputDialog("Enter second integer:");将字符串类型转换成整数类型number1= Integer. (3) (firstNumber);number2= Integer.parselnt(secondNumber);result= "":if ((4))result=number1+"=="+number2;if (number1 != number2)result=number1+"!="+number2;if (number1<number2)result=result+"\n"+number1+"<"+ number2;if (number1>number2)result=result+"\n"+number1+">"+number2;if (number1<=number2)result=result+"\n"+number1+"<="+number2;if (numbed>=number2)result=result+"\n"+number1+">="+number2;//显示结果JOptionPane.(5).(null, result, "Comparison Results",JOptionPane. INFORMATION_MESSAGE);//程序正常退出System.exit(0);}}

考题 阅读下面程序import javax.swing.JOptionPane;public class Comparison{public static void main(String args[]){String firstNumber, //用户输入第1个数据变量second Number, //用户输入第2个数据变量result; //输出结果变量int number1, //用于比较的第1个数number2; //用于比较的第2个数//用户输入第1个数据的字符串firstNumber=JOptionPane. showInputDialog(“输入第1个整数:”);//用户输入第2个数据的字符串secondNumber=JOptionPane.showlnputDialog(“输入第2个整数:”);//将字符串转换为整数类型number1=Integer.parseInt(firstNumber);number2=Integer.parseInt(secondNumber);//初始化结果变量___________________;//比较两个数据if(number1=number2)result += number1 +" =" + number2;if(number1 != number2 )result += numberl +" !=" + number2;if( number1 < number2 )result = result + "\n" + numberl +" <" + number2;if(number1 > number2 )result = result + "\n" + number1 + ">" + number2;if( number1 <= number2 )result = result + "\n" + number1 +" <=" + number2;if (number1 >= number2 )result = result + "\n" + number1 + ">=" + number2;//显示结果JOptionPane.showMessageDialog(null,result," 比较结果",JOptionPane. INFORMATION_MESSAGE);System.exit(0);}}为使程序能正确运行并得到合理的输出结果,初始化结果变量语句(下划线处)应是A.result = ""B.result = nullC.result = number1D.result = number2

考题 阅读下面程序import javax.swing.JOptionPane;public class Comparison {public static void main(String args[]) {String firstNumber, //用户输入第1个数据变量secondNumber, //用户输入第2个数据变量result; //输出结果变量int number1, //用于比较的第1个数number2; //用于比较的第2个数//用户输入第1个数据的字符串firstNuinber=JOptionPane.showInputDialog("输入第1个整数:");//用户输入第2个数据的字符串secondNumber=JOptionPane.showInputDialog("输入第2个整数:");//将字符串转换为整数类型number1=Integer.parseInt(firstNumber);number2=Integer.parseInt(secondNumber);//初始化结果变量______//比较两个数据if(number1==number2)result+=number1+"=="+number2;if(number1! =number2) result+=number1+"!="+number2;if(number1<number2) result=result+"\n"+number1+"<"+number2;if(number1>number2) result=result+"\n"+number1+">"+number2;if(number1<=number2) result=result+"\n"+number1+"<="+number2;if(number1>=number2) result=result+"\n"+number1+">="+number2://显示结果JOptionPane.showMessageDialog(null,result."比较结果",JOptionPane.INFORMATION_MESSAGE);System.exit(0);}}为使程序能正确运行并得到合理的输出结果,初始化结果变量语句(下画线处)应是A.result=" ";B.result=nullC.result=number1D.result=number2

考题 下列程序的运行结果是( )。 public class Sun { public static void main(String args[ ]) { int number,digits; number=53; if(number<10) digits=1; else if(number<100) digits=2; else digits=3; System.out.println(digits); } }A.1B.2C.3D.0

考题 定义如下枚举类型:enum Number{one=l,tow=2,four=4,eight=8},则下列语句正确的是( )。A.Number num=1;B.Number num=Number(20);C.Number num=Number(eight|0xFF);D.枚举类型Number的取值范围是0~15

考题 阅读下面程序: import javax.swing.JOptionPane; public class Comparison { public static void main (Stringargs[]){ String firstNumber, //用户输入第1个数据变量 secondNumber, //用户输入第2个数据变量 result; //输出结果变量 mtnumberl, //用于比较的第1个数 number2; //用于比较的第2个数 //用户输入第1个数据的字符串 firstNumber=JOptionPane.showlnputDialog(“输入第1个整数:”) //用户输入第2个数据的字符串 secondNumber=JOptionPane。showlnputDialog(“输入第2个整数:”); //将字符串转换为整数类型 number1=Integer.parseInt(firstNumber); number2=Integer.parseInt(secondNumber); //初始化结果变量 _________________________; //比较两个数据 if(number1=number2) result+=numberl+"="+number2; if(number1 !=number2) resun+=numberl+"!="+number2; if(number1<number2) result=result+"\n"+number1+"<"+nunlber2; if(number1>number2) result=result+"\n"+numberl+">"+number2; if(numberl<=number2) result二reSUlt+”h1”+numberl+”仁”+number2; if(number1>=number2) result=result+"\n"+number1+">="+number2; //显示结果 JOpdonPane.showMessageDialog(null,rcsult, "比较结果", JOpdonPane.INFORMATION_MESSAGE; System,exIT(0); } } 为使程序能正确运行并得到合理的输出结果,初始化结果变量语句(下划线处)应是 ( )。A.result=""B.resnlt=nullC.resun=number1D.result=number2

考题 下面程序的功能是由随机函数产生100个在200~700之间的整数,然后找出最大者,并记下是第几个数,但程序不完整,请选择适当的内容在下划线处将程序补充完整。 Dim a(100) For j=1 To 100 a(j)=Int(Rnd*501+200):Print a(j) Next j : Print p=1 : max= ______ For j=2 To 100 If a(j)>max Then max=a(j) : p=j Next j Print "The largest number is " ; max Print "The position is"; p EndA.0B.a(1)C.1.7E+38D.1.7E-38

考题 阅读以下说明和C语言函数,将应填入(n)处的字句写在对应栏内。【说明】输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。【函数】main ( ){int number[10];input (number);max min (number);output (number);}input (number)int number[10];{int i;for ( i=0;i<9;i++ )scanf ( "%d,",number[i] );scanf ( "%d",number[9] );}max_min ( array )int array[10];{int *max,*min,k,1;int *p,*arr_end;arr end=(1);max=min=array;for ( p=(2);p<arr_end;p++ )if((3)) max=p;else if ( *p<*min ) min=p;(4);l=*min;(5);array[0]=1;1=*p;*p=array[9];array[9]=k;k=*p;return;}output ( array )int array[10];{ int *p;for ( p=array;p<array+9;p++ )printf ( "%d,",*p );printf ( "%d\n",array[9] );}

考题 有以下程序:includemain(){char k; int i; for(i=1;i 有以下程序: #include <stdio.h> main() { char k; int i; for(i=1;i<3;i++) { scanf("%c",k); switch(k) { case '0': printf("another\n"); case '1': printf("number\n"); } { } 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是( )。A.another numberB.another number anotherC.another numberD.number number

考题 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command_Click( ) S=0 Do s=(s + 1) * (s +2) Number=Number+1 Loop Until S>=30 Print Number,S End Sub 程序运行后,输出的结果是A.2 3B.3 182C.5 12D.10 20

考题 以下的变量声明是正确的。 final MAX_NUMBER; 。() 此题为判断题(对,错)。

考题 以下的语句是正确的。 final int MAX_NUMBER=20; MAX_NUMBER++; 。() 此题为判断题(对,错)。

考题 阅读以下Java代码,填充(1)~(5)的空缺,将解答填入答题纸的对应栏内。 【说明】进行两个整数之间的比较,由考生通过输入窗口分别输入两个整数,程序比较出结果。例如:先后输入的两个数分别为25和36。 比较结果显示: 25!=36 25<36 25<=36 【Java代码】 import javax.swing.JOptionPane; public class Java3 { public static void main(String args[]) { String (1) //用户输入第1个字符串 secondNuimber, //用户输入第2个字符串 result; //包含输出结果的字符串 int number1, //比较的第1个数 number2; //比较的第2个数 //读用户输入的第1个字符串 firstNumber= JOptionPane(2)("Enter first integer:"); //读用户输入的第2个字符串 secondNumber= JOpttionPane.showlnputDialog("Enter second integer:"); //将字符串类型转换成整数类型 number1=Integer.(3)(firstNumber); number2=Integer.parselnt(secondNumber); result=""; if((4)) result=number1+"=="+number2; if(number1!=number2) result=number1+"!=”"+number2; if(number1<number2) result=result+"\n"+number1+"<"+number2; if(numbe1>number2) result=result+"\n"+number1+">"+number2; if(number1<=number2) result=result+"\n"+number1+"<="+number2; if(number1>=number2) result=result+"\n"+number1+">="+number2; //显示结果 JOptionPane.(5)( null,result,"Comparison Results", JOptionPane.INFORMATION_MESSAGE.; //程序正常退出 System.exit(0); }}

考题 下列选项中,属于input元素的number类型属性的是()。A、min属性B、max属性C、list属性D、step属性

考题 inputtype=”number”min=“1”max=“5”/在标签内可以添加的数字为()。A、2B、3C、6D、7

考题 Which of the following parameters must be specified to define the number of dispatchers that need to be started?()A、MAX_DISPATCHERSB、DISPATCHERSC、MIN_DISPATCHERSD、SHARED_SERVERS

考题 单选题Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_ NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) JOB_CAT VARCHAR2(30) SALARY NUMBER(8,2) Which statement shows the department ID, minimum salary, and maximum salary paid in that department, only if the minimum salary is less than 5000 and maximum salary is more than 15000?()A SELECT dept_id, MIN(salary), MAX(salary) FROM employees WHERE MIN(salary) 5000 AND MAX(salary) 15000;B SELECT dept_id, MIN(salary), MAX(salary) FROM employees WHERE MIN(salary) 5000 AND MAX(salary) 15000 GROUP BY dept_id;C SELECT dept_id, MIN(salary), MAX(salary) FROM employees HAVING MIN(salary) 5000 AND MAX(salary) 15000;D SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id HAVING MIN(salary) 5000 AND MAX(salary) 15000;E SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id, salary HAVING MIN(salary) 5000 AND MAX(salary) 15000;

考题 单选题1)#include 2)# include 3)using namespace std; 4)double max(double x,doubley); 5)void main() 6){ 7)double a,b,c; 8)cout ab; 10)c=max(a,b); 11)couty) 16)returnx; 17)else 18)returny; 19)} 程序第8行执行完后,光标在:()A input two number:前面B input two number:后面C input two number:下一行首列D 不确定

考题 单选题Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) JOB_CAT VARCHARD2(30) SALARY NUMBER(8,2) Which statement shows the maximum salary paid in each job category of each department?()A SELECT dept_id, job_cat, MAX(salary) FROM employees WHERE salary MAX (salary);B SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id,job_cat;C SELECT dept_id, job_cat, MAX(salary) FROM employees;D SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id;E SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept _ id job _ cat salary;

考题 单选题The STUDENT_GRADES table has these columns: STUDENT_ID NUMBER(12) SEMESTER_END DATE GPA NUMBER(4,3) Which statement finds the highest grade point average (GPA) per semester?()A SELECT MAX (gpa) FROM student _ grades WHERE gpa IS NOT NULL;B SELECT (gpa) FROM student _ grades GROUP BY semester_end WHERE gpa IS NOT NULL;C SELECT MAX (gpa) FROM student _ grades WHERE gpa IS NOT NULL GROUP BY semester_end;D SELECT MAX (gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student _ grades;E SELECT MAX (gpa) FROM student _ grades GROUP BY semester_end WHERE gpa IS NOT NULL;

考题 单选题1)#include 2)#include 3)using namespace std; 4)double max(double x,doubley) 5){ 6)if(xy) 7)return x; 8)else 9)return y; 10)} 11)int main() 12){ 13)doublea,b,c; 14)cout a b; 16)c=max(a,b); 17)cout " the squart of max imum=" sqrt( c ); 18)} 执行完第14行后,命令提示符窗口中光标的位置在:()A input two number:前面B input two number:后面C input two number:下一行首列D 不确定