阅读以下FORTRAN程序 READ(*,*)M,N. K=MOD(M,N) 10 IF(K.GT.0)THEN M=N N=K K=MOD(M,N) GOT0 10 END IFWRITE(*,*)N END 若运行以上程序时,由键盘输入25,11,则程序输出为( )。
A:3 B:2 C:1 D:0
下列程序的运行结果是______。
public class test
private String [] data="10","10.5");
public void fun( )
double s=0;
for(int i=0; i<3; i++)
try
s=s+Integer. parseInt(data[i]);
catch(Exception e)
System. out. print("errorl:"+data[i]);
public static void main(string [] args)
try
test d=new test( );
d. fun( );
catch(Exception e)
System. Out. println("error2")
A:error1:10.5 B:error2 C:error1:10.5 error2 D:以上都不对
下列代码的执行结果是______。
public class Test
public static void main(String[]args)
int[]x=0,1,2,3;
forint i=0; i<3; 1+=2)
try
system. out. println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System. out. println("errorl");
catch(Exception e)
System. out. println("error2");
A:errorl B:error2 C:errorl error2 D:2 error2
下列程序的运行结果是( )。
public class test
private String[]data="10","10.5";
public void fun( )
double s=0;
for(int i=0;i<3;i++)
try
s=s+Integer.parseInt(data[i]);
catch(Exception e)
System.out.print("errorl:"+data[i]);
public static void main(string[]args)
try
test d=new test( );
d.fun( );
catch(Exception e)
System.out.println("error2")
A:error1:10.5 B:error2 C:error1:10.5 error2 D:以上都不对
下列代码的执行结果是( )。
public class Test
public static void main(String[]args)
int[]x=0,1,2,3;
forint i=0;i<3;1+=2)
try
system.out.println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch(Exception e)
System.out.println("error2");
A:error1 B:error2 C:error1
orror2 D:2
error2
有以下程序: #include <iostream> #include <cstdlib> using namespace std; int main( ) { int arraysize; int *array; cout<<"Please input the size of the array:"; cin>>arraySiZe; array=new int[arraysize]; if(array==NULL) { cout<<"allocate Error/n"; exit(1); } for(int i=0;i<arraysize;i++) array[i]=i*i; int j; cout<<"which element you want to check:"; cin>>j; cout<<array[j]<<end1; return 0; } 执行程序输入:10<空格>5,则输出结果为( )。
A:allocate Error B:1 D:25
下列代码的执行结果是()public class Test { public static void main(String[] args) { int[] x={0,1,2,3}; for(int i=0;i<3;i+=2){ try{ System.out.println(x[i+2]/x[i]+x[i+1]); }catch(ArithmeticException e){ System.out.println("error1"); }catch(Exception e){ System.out.println("error2"); } } } }
A:error1 B:error2 C:error1 error2 D:2 error2
下列程序的运行结果是()
public class test
private String[] data="10","10.5";
public void fun( )
double s=0;
for(int i=0;i<3;i++)
try
s=s+Integer .parseInt(data[i]);
catch(Exception e)
System.out.print("error1:"+data[i]);
public static void main(String[]args)
try
testd=new test( );
d.fun( );
catch(Exception e)
System.out.printIn("error2");
A:error1:10.5 B:error2 C:error1:10.5 error2 D:以上都不对
下列代码的执行结果是()。
public class Test
public static void main(String[] args)
int[] x=0,1,2,3;
for(int i=0;i<3;i+=2)
try
System.out.println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch(Exception e)
System.out.println("error2");
A:error1 B:error2 C:error1 D:error2 E:2 F:error2
下列代码的执行结果是______。
public class Test
public static void main(String[]args)
int[]x=0, 1, 2, 3;
for(int i=0;i<3;i+=2)
try
System.out println(x[i+23/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch (Exception e)
System.out.println("error2");
A:error1 B:error2 C:error1 D:2
error2 error2