The school was moved out of downtown as the number of students had grown too_______.
A.small
B.few
C.1arge
D.many
“Sorry Sir, this bus is () downtown, you’ve taken the wrong bus.”A、make toB、aim toC、bound forD、direct to
点击查看答案
试题五(共15分)阅读以下说明和 C++代码,将应填入 (n) 处的语句或语句成分写在答题纸的对应栏内。【说明】某数据文件students.txt的内容为100名学生的学号和成绩,下面的程序将文件中的数据全部读入对象数组,按分数从高到低进行排序后选出排名前 30%的学生。【C++代码】#include #include #include using namespace std;class Student {private:string sNO; //学号int credit; //分数public:Student(string a,int b) { sNO = a; credit = b;}Student(){}int getCredit();void out();};(1) ::getCredit() {return credit;}(2) ::out() {cout << "SNO: " << sNO << ", Credit=" << credit << endl;}class SortStudent {public:void sort(Student *s, int n);SortStudent(){}};void SortStudent::sort(Student *s,int n) {for(int i = 0; i < n-1; i++) {for(int j = i+1; j < n; j++) {if(s[i]. (3) < s[j]. (4) ) {Student temp = s[i]; s[i] = s[j]; s[j] = temp;}}}}int main(int argc, char* argv[]){const int number = 100; //学生总数ifstream students;students.open("students.txt");if(!students.is_open()) {throw 0;}Student *testStudent = (5) [number];int k = 0;string s;while (getline(students,s,'\n')) { //每次读取一个学生的学号和成绩Student student(s.substr(0,s.find(',')), atoi(s.substr(s.find(',')+1).c_str()));testStudent[k++] = student;}students.close();(6) ;ss.sort(testStudent,k);cout <<"top 30%: "<<endl;for(k = 0; k < number * 0.3; k++) {testStudent[k].out();}delete []testStudent;return 0;}
阅读下列Java程序和程序说明,将应填入(n)处的字句写在对应栏内。【说明】本程序ExceptionTester实现功能:读入两个整数,第1个数除以第2个数,之后输出。若第2个数为0,则自动进行异常处理。程序如下:(1);public class ExceptionTester{public static void main(String args[]){int result;int number[]=new int[2];boolean valid;for(int i=0;i<2;i++){valid=(2);while(!valid){try{System.out.println("Enter number"+(i+1));number[i]=Integer.valueOf(Keyboard.getString()).intValue();valid=true;}catch(NumberFormatExceptione){System.out.println("Invalid integer entered.Please try again.");}}}by{result=number[0]/number[1];System.out.print(number[0]+"/"+number[1]+"="+result);}catch((3)){System.out.println("Second number is 0,cannot do division!");}}}其中,Keyboard类的声明为:impon java.io.*;public class Keyboard{static BufferedReader inputStream=new (4)(new InputStreamReader(System.in));public static int getInteger(){try{return(Integer,valueOf(inputStream.readLlne().trim()).intValue());}catch(Exceptione){e.printStackTrace();return 0;}}public (5) {by{return(inputStream.readLine());} catch(IOExceptione){return "0";}}}
After ten years,all those youngsters became().A、growns-upB、growns-upC、grown-upD、grown-ups
classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt("classNumber{publicstaticvoidmain(String[]args){try{System.out.print(Integer.parseInt("forty"));}catch(RuntimeExceptionr){System.out.print("runtime");}catch(NumberFormatExceptione){System.out.print("number");}}}结果是什么?()A.fortyB.numberC.runtimeD.编译失败
现有:classNumber{publicstaticvoidmain(String[]aras){try{System.out.print(Integer.parselnt("forty"));}catch(RuntimeExceptionr){System.out.print("runtime");}catch(NumberFormatExceptione){system..ut.print("number");}}}结果是什么?()A.numberB.runtimeC.fortynumberD.编译失败
下列程序的运行结果是( )。 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